Skip to content
Permalink
Browse files
Fixed crash if some initialization succeeded and some didn't, thanks …
…to Dongwon Kang
  • Loading branch information
slouken committed Feb 15, 2016
1 parent 934c4fb commit 156d34df8ca81688429b6a3c234f42c19274cb11
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
@@ -386,7 +386,7 @@ SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src)
}
start = SDL_RWtell(src);

if ( !IMG_Init(IMG_INIT_JPG) ) {
if ( (IMG_Init(IMG_INIT_JPG) & IMG_INIT_JPG) == 0 ) {
return NULL;
}

@@ -362,7 +362,7 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
}
start = SDL_RWtell(src);

if ( !IMG_Init(IMG_INIT_PNG) ) {
if ( (IMG_Init(IMG_INIT_PNG) & IMG_INIT_PNG) == 0 ) {
return NULL;
}

@@ -217,7 +217,7 @@ SDL_Surface* IMG_LoadTIF_RW(SDL_RWops* src)
}
start = SDL_RWtell(src);

if ( !IMG_Init(IMG_INIT_TIF) ) {
if ( (IMG_Init(IMG_INIT_TIF) & IMG_INIT_TIF) == 0 ) {
return NULL;
}

@@ -196,7 +196,7 @@ SDL_Surface *IMG_LoadWEBP_RW(SDL_RWops *src)

start = SDL_RWtell(src);

if ( !IMG_Init(IMG_INIT_WEBP) ) {
if ( (IMG_Init(IMG_INIT_WEBP) & IMG_INIT_WEBP) == 0 ) {
goto error;
}

0 comments on commit 156d34d

Please sign in to comment.