From b82ea16d69aa794e9f8daf36f30d57c8c53dab19 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Tue, 13 Dec 2022 15:51:54 +0100 Subject: Fix compiler warning [-Wmaybe-uninitialized] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fl_BMP_Image.cxx:228:30: warning: ‘width’ may be used uninitialized in this function 228 | int maskSize = (((width*Bpp+3)&~3)*height) + ... | ~~~~~^~~~ --- src/Fl_BMP_Image.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Fl_BMP_Image.cxx b/src/Fl_BMP_Image.cxx index 7610652cb..95a467a3a 100644 --- a/src/Fl_BMP_Image.cxx +++ b/src/Fl_BMP_Image.cxx @@ -205,7 +205,8 @@ void Fl_BMP_Image::load_bmp_(Fl_Image_Reader &rdr, int ico_height, int ico_width height = ico_height; } else { // New BMP header... - w(rdr.read_long()); + width = rdr.read_long(); + w(width); // If the height is negative, the row order is flipped temp = rdr.read_long(); if (temp < 0) row_order = 1; -- cgit v1.2.3