From b8eb5f17a1e389d9a89e402b1ed8f9916fb48da0 Mon Sep 17 00:00:00 2001 From: Ankith Date: Sun, 17 Dec 2023 20:06:07 +0530 Subject: [PATCH] Fix regression (segfault) in LBM image loading --- src/IMG_lbm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/IMG_lbm.c b/src/IMG_lbm.c index b165fb08..b0a0fb36 100644 --- a/src/IMG_lbm.c +++ b/src/IMG_lbm.c @@ -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 */