This commit is contained in:
Ray
2026-07-13 19:25:08 +02:00
4 changed files with 9 additions and 7 deletions

4
src/external/rlsw.h vendored
View File

@@ -4307,8 +4307,8 @@ void swScissor(int x, int y, int width, int height)
RLSW.scClipMin[0] = (2.0f*(float)RLSW.scMin[0]/(float)RLSW.vpSize[0]) - 1.0f;
RLSW.scClipMax[0] = (2.0f*(float)RLSW.scMax[0]/(float)RLSW.vpSize[0]) - 1.0f;
RLSW.scClipMax[1] = 1.0f - (2.0f*(float)RLSW.scMin[1]/(float)RLSW.vpSize[1]);
RLSW.scClipMin[1] = 1.0f - (2.0f*(float)RLSW.scMax[1]/(float)RLSW.vpSize[1]);
RLSW.scClipMin[1] = (2.0f*(float)RLSW.scMin[1]/(float)RLSW.vpSize[1]) - 1.0f;
RLSW.scClipMax[1] = (2.0f*(float)RLSW.scMax[1]/(float)RLSW.vpSize[1]) - 1.0f;
}
void swClearColor(float r, float g, float b, float a)

View File

@@ -1255,12 +1255,14 @@ Image GetClipboardImage(void)
for (int i = 0; i < SDL_arraysize(imageFormats); i++)
{
// NOTE: This pointer should be free with SDL_free() at some point
fileData = SDL_GetClipboardData(imageFormats[i], &dataSize);
if (fileData)
{
image = LoadImageFromMemory(imageExtensions[i], fileData, (int)dataSize);
SDL_free(fileData);
if (IsImageValid(image))
{
TRACELOG(LOG_INFO, "Clipboard: Got image from clipboard successfully: %s", imageExtensions[i]);

View File

@@ -1699,7 +1699,7 @@ const char *TextSubtext(const char *text, int position, int length)
static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 };
memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH);
if ((text != NULL) && (position > 0) && (length > 0))
if ((text != NULL) && (position >= 0) && (length > 0))
{
int textLength = TextLength(text);

View File

@@ -1231,9 +1231,9 @@ Image ImageFromImage(Image image, Rectangle rec)
Image result = { 0 };
// Basic rectangle validation: size smaller than image size
if ((rec.x > 0) && (rec.y > 0) && (rec.width > 0) && (rec.height > 0) &&
(((int)rec.x + (int)rec.width) < image.width) &&
(((int)rec.y + (int)rec.height) < image.height))
if ((rec.x >= 0) && (rec.y >= 0) && (rec.width > 0) && (rec.height > 0) &&
(((int)rec.x + (int)rec.width) <= image.width) &&
(((int)rec.y + (int)rec.height) <= image.height))
{
int bytesPerPixel = GetPixelDataSize(1, 1, image.format);