summaryrefslogtreecommitdiff
path: root/src/render/software/SDL_rotate.c
diff options
context:
space:
mode:
authorSam Lantinga <slouken@libsdl.org>2017-09-21 01:22:40 -0700
committerSam Lantinga <slouken@libsdl.org>2017-09-21 01:22:40 -0700
commit729ebeaadfaa151175c61a9714f9c4e28dfe0ea5 (patch)
treec787b94e8c606ce5a18e27c205f3b0d3a0ff10f7 /src/render/software/SDL_rotate.c
parentdcf98a35c751d3c14c29ad164c63e862379bea1e (diff)
Fixed bug 3788 - software renderer crashes in SDL_RenderCopyEx with rotation and dstrect w or h is 0
Anthony This is what's making the software renderer crash with rotated destination rectangles of w or h = 0: SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "2");
Diffstat (limited to 'src/render/software/SDL_rotate.c')
-rw-r--r--src/render/software/SDL_rotate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/render/software/SDL_rotate.c b/src/render/software/SDL_rotate.c
index 6b6c2fa091..44762048fa 100644
--- a/src/render/software/SDL_rotate.c
+++ b/src/render/software/SDL_rotate.c
@@ -257,7 +257,7 @@ _transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int
dy = (sdy >> 16);
if (flipx) dx = sw - dx;
if (flipy) dy = sh - dy;
- if ((unsigned)dx < (unsigned)sw && (unsigned)dy < (unsigned)sh) {
+ if ((dx > -1) && (dy > -1) && (dx < (src->w-1)) && (dy < (src->h-1))) {
sp = (tColorRGBA *) ((Uint8 *) src->pixels + src->pitch * dy) + dx;
c00 = *sp;
sp += 1;