summaryrefslogtreecommitdiff
path: root/src/video/SDL_fillrect.c
diff options
context:
space:
mode:
authorRyan C. Gordon <icculus@icculus.org>2019-10-15 14:55:09 -0400
committerRyan C. Gordon <icculus@icculus.org>2019-10-15 14:55:09 -0400
commitd7de5cfdeb4ba2c74135732ddbc8f349c92a23e2 (patch)
treea14d84fe5e9c90f787af320913cfccebcfcb3556 /src/video/SDL_fillrect.c
parent935a92c68753a17b0946d769245006767034d42c (diff)
downloadsdl-d7de5cfdeb4ba2c74135732ddbc8f349c92a23e2.tar.gz
video: Make sure SDL_FillRects()'s fill_function isn't used unitialized.
Diffstat (limited to 'src/video/SDL_fillrect.c')
-rw-r--r--src/video/SDL_fillrect.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/video/SDL_fillrect.c b/src/video/SDL_fillrect.c
index dbea4a2b1..899a1a5ba 100644
--- a/src/video/SDL_fillrect.c
+++ b/src/video/SDL_fillrect.c
@@ -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) {
@@ -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");
}