Skip to content

Commit af98e31

Browse files
committed
Merge branch 'master' of https://github.com/raysan5/raylib
2 parents e063385 + 7a247ff commit af98e31

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/external/rlsw.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4307,8 +4307,8 @@ void swScissor(int x, int y, int width, int height)
43074307

43084308
RLSW.scClipMin[0] = (2.0f*(float)RLSW.scMin[0]/(float)RLSW.vpSize[0]) - 1.0f;
43094309
RLSW.scClipMax[0] = (2.0f*(float)RLSW.scMax[0]/(float)RLSW.vpSize[0]) - 1.0f;
4310-
RLSW.scClipMax[1] = 1.0f - (2.0f*(float)RLSW.scMin[1]/(float)RLSW.vpSize[1]);
4311-
RLSW.scClipMin[1] = 1.0f - (2.0f*(float)RLSW.scMax[1]/(float)RLSW.vpSize[1]);
4310+
RLSW.scClipMin[1] = (2.0f*(float)RLSW.scMin[1]/(float)RLSW.vpSize[1]) - 1.0f;
4311+
RLSW.scClipMax[1] = (2.0f*(float)RLSW.scMax[1]/(float)RLSW.vpSize[1]) - 1.0f;
43124312
}
43134313

43144314
void swClearColor(float r, float g, float b, float a)

src/platforms/rcore_desktop_sdl.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1255,12 +1255,14 @@ Image GetClipboardImage(void)
12551255

12561256
for (int i = 0; i < SDL_arraysize(imageFormats); i++)
12571257
{
1258-
// NOTE: This pointer should be free with SDL_free() at some point
12591258
fileData = SDL_GetClipboardData(imageFormats[i], &dataSize);
12601259

12611260
if (fileData)
12621261
{
12631262
image = LoadImageFromMemory(imageExtensions[i], fileData, (int)dataSize);
1263+
1264+
SDL_free(fileData);
1265+
12641266
if (IsImageValid(image))
12651267
{
12661268
TRACELOG(LOG_INFO, "Clipboard: Got image from clipboard successfully: %s", imageExtensions[i]);

src/rtext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1699,7 +1699,7 @@ const char *TextSubtext(const char *text, int position, int length)
16991699
static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 };
17001700
memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH);
17011701

1702-
if ((text != NULL) && (position > 0) && (length > 0))
1702+
if ((text != NULL) && (position >= 0) && (length > 0))
17031703
{
17041704
int textLength = TextLength(text);
17051705

src/rtextures.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,9 +1231,9 @@ Image ImageFromImage(Image image, Rectangle rec)
12311231
Image result = { 0 };
12321232

12331233
// Basic rectangle validation: size smaller than image size
1234-
if ((rec.x > 0) && (rec.y > 0) && (rec.width > 0) && (rec.height > 0) &&
1235-
(((int)rec.x + (int)rec.width) < image.width) &&
1236-
(((int)rec.y + (int)rec.height) < image.height))
1234+
if ((rec.x >= 0) && (rec.y >= 0) && (rec.width > 0) && (rec.height > 0) &&
1235+
(((int)rec.x + (int)rec.width) <= image.width) &&
1236+
(((int)rec.y + (int)rec.height) <= image.height))
12371237
{
12381238
int bytesPerPixel = GetPixelDataSize(1, 1, image.format);
12391239

0 commit comments

Comments
 (0)