Skip to content

Commit

Permalink
video: Make sure SDL_FillRects()'s fill_function isn't used unitialized.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Oct 15, 2019
1 parent eb066a7 commit 02a2ec9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/video/SDL_fillrect.c
Expand Up @@ -259,7 +259,7 @@ SDL_FillRects(SDL_Surface * dst, const SDL_Rect * rects, int count,
SDL_Rect clipped;
Uint8 *pixels;
const SDL_Rect* rect;
void (*fill_function)(Uint8 * pixels, int pitch, Uint32 color, int w, int h);
void (*fill_function)(Uint8 * pixels, int pitch, Uint32 color, int w, int h) = NULL;
int i;

if (!dst) {
Expand Down Expand Up @@ -326,6 +326,9 @@ SDL_FillRects(SDL_Surface * dst, const SDL_Rect * rects, int count,
fill_function = SDL_FillRect4;
break;
}

default:
return SDL_SetError("Unsupported pixel format");
}


Expand Down

0 comments on commit 02a2ec9

Please sign in to comment.