Skip to content

Commit

Permalink
Fixed crash if some initialization succeeded and some didn't, thanks …
Browse files Browse the repository at this point in the history
…to Dongwon Kang
  • Loading branch information
slouken committed Feb 15, 2016
1 parent 934c4fb commit 156d34d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion IMG_jpg.c
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion IMG_png.c
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion IMG_tif.c
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion IMG_webp.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit 156d34d

Please sign in to comment.