From 6c295129ba6121c6ba3fe1488067eb07fc350796 Mon Sep 17 00:00:00 2001 From: Sylvain Becker Date: Sat, 31 Aug 2019 22:58:11 +0200 Subject: [PATCH] LoadBMP: fix some warnings --- src/video/SDL_bmp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c index a10ea2cb3..46ce28a56 100644 --- a/src/video/SDL_bmp.c +++ b/src/video/SDL_bmp.c @@ -173,7 +173,7 @@ SDL_Surface * SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) { SDL_bool was_error; - Sint64 fp_offset; + Sint64 fp_offset = 0; int bmpPitch; int i, pad; SDL_Surface *surface; @@ -199,15 +199,15 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) /* The Win32 BITMAPINFOHEADER struct (40 bytes) */ Uint32 biSize; - Sint32 biWidth; + Sint32 biWidth = 0; Sint32 biHeight = 0; Uint16 biPlanes; - Uint16 biBitCount; - Uint32 biCompression; + Uint16 biBitCount = 0; + Uint32 biCompression = 0; Uint32 biSizeImage; Sint32 biXPelsPerMeter; Sint32 biYPelsPerMeter; - Uint32 biClrUsed; + Uint32 biClrUsed = 0; Uint32 biClrImportant; /* Make sure we are passed a valid data source */ @@ -390,7 +390,7 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc) } /* Create a compatible surface, note that the colors are RGB ordered */ - surface = SDL_CreateRGBSurface(SDL_SWSURFACE, + surface = SDL_CreateRGBSurface(0, biWidth, biHeight, biBitCount, Rmask, Gmask, Bmask, Amask); if ( surface == NULL ) { was_error = SDL_TRUE;