From d6fb9cf83ceb6dd63fcc8954d6ce49f0ee5edfd1 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Wed, 22 Oct 2025 03:02:30 +0300
Subject: [PATCH] IMG_bmp.c: fix -Wuninitialized warnings:
IMG_bmp.c: In function 'LoadICOCUR_IO.clone.0':
IMG_bmp.c:600: warning: 'nWidth' may be used uninitialized in this function
IMG_bmp.c:600: warning: 'nHeight' may be used uninitialized in this function
IMG_bmp.c:600: warning: 'nColorCount' may be used uninitialized in this function
---
src/IMG_bmp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/IMG_bmp.c b/src/IMG_bmp.c
index fa61918e..790d92eb 100644
--- a/src/IMG_bmp.c
+++ b/src/IMG_bmp.c
@@ -597,7 +597,8 @@ static SDL_Surface *LoadICOCUR_IO(SDL_IOStream *src, int type, bool closeio)
Uint16 wBitCount;
Uint32 dwBytesInRes;
Uint32 dwImageOffset;
- int nWidth, nHeight, nColorCount, nHotX, nHotY;
+ int nWidth, nHeight, nColorCount;
+ int nHotX, nHotY;
if (!SDL_ReadU8(src, &bWidth) ||
!SDL_ReadU8(src, &bHeight) ||
@@ -618,6 +619,7 @@ static SDL_Surface *LoadICOCUR_IO(SDL_IOStream *src, int type, bool closeio)
nHotY = 0;
}
+ nWidth = nHeight = nColorCount = 0;
if (!GetIconInfo(src, start + dwImageOffset, &nWidth, &nHeight, &nColorCount)) {
continue;
}