Skip to content

Commit

Permalink
Fixed bug 3788 - software renderer crashes in SDL_RenderCopyEx with r…
Browse files Browse the repository at this point in the history
…otation 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");
  • Loading branch information
slouken committed Sep 21, 2017
1 parent 8b660c5 commit 5ae90ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/render/software/SDL_rotate.c
Expand Up @@ -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;
Expand Down

0 comments on commit 5ae90ef

Please sign in to comment.