Skip to content

Commit

Permalink
Fix regression (segfault) in LBM image loading
Browse files Browse the repository at this point in the history
  • Loading branch information
ankith26 authored and slouken committed Dec 17, 2023
1 parent 42b2dee commit a38dd11
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/IMG_lbm.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,9 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src )
format = SDL_PIXELFORMAT_BGR24;
#endif
}
if (nbplanes == 24 || flagHAM == 1) {
if ((Image = SDL_CreateRGBSurfaceWithFormat(0, width, bmhd.h, 0, format)) == NULL ){
goto done;
}
}
if ((Image = SDL_CreateRGBSurfaceWithFormat(0, width, bmhd.h, 0, format)) == NULL){
goto done;
}
}

if ( bmhd.mask & 2 ) /* There is a transparent color */
Expand Down

0 comments on commit a38dd11

Please sign in to comment.