From 49fc6143abaa1ea4262093ba47404bb2a7d15476 Mon Sep 17 00:00:00 2001 From: SNMetamorph <25657591+SNMetamorph@users.noreply.github.com> Date: Tue, 22 Nov 2022 22:13:02 +0400 Subject: [PATCH] engine: common: imagelib: fixed loading 32 bits per pixel BMP files --- engine/common/imagelib/img_bmp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/engine/common/imagelib/img_bmp.c b/engine/common/imagelib/img_bmp.c index 1fa0c4c3..f0f9785a 100644 --- a/engine/common/imagelib/img_bmp.c +++ b/engine/common/imagelib/img_bmp.c @@ -69,8 +69,11 @@ qboolean Image_LoadBMP( const char *name, const byte *buffer, fs_offset_t filesi // bogus compression? Only non-compressed supported. if( bhdr.compression != BI_RGB ) { - Con_DPrintf( S_ERROR "Image_LoadBMP: only uncompressed BMP files supported (%s)\n", name ); - return false; + if( bhdr.bitsPerPixel != 32 || bhdr.compression != BI_BITFIELDS ) + { + Con_DPrintf( S_ERROR "Image_LoadBMP: only uncompressed BMP files supported (%s)\n", name ); + return false; + } } image.width = columns = bhdr.width;