From 0ee76b088946f470bf91a6239c87116802f33362 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 e490fd53..9623ed99 100644 --- a/src/IMG_lbm.c +++ b/src/IMG_lbm.c @@ -260,11 +260,9 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src ) format = SDL_PIXELFORMAT_BGR24; #endif } - if (nbplanes == 24 || flagHAM == 1) { - if ((Image = SDL_CreateSurface(width, bmhd.h, format)) == NULL ){ - goto done; - } - } + if ((Image = SDL_CreateSurface(width, bmhd.h, format)) == NULL){ + goto done; + } } if ( bmhd.mask & 2 ) /* There is a transparent color */