diff options
author | Albert Astals Cid <aacid@kde.org> | 2019-01-30 01:31:30 +0100 |
---|---|---|
committer | Albert Astals Cid <albert.astals.cid@kdab.com> | 2019-01-30 10:13:27 +0000 |
commit | f383fa4b9c64e319cb9b8a63ca88368ad752db27 (patch) | |
tree | 38a4fc6aff8d807ee35795f37a388b50e2456c4f /src/gui/image | |
parent | 5d885c8325f1c1567d08b580399dfd6ce4c5ab97 (diff) | |
download | qtbase-f383fa4b9c64e319cb9b8a63ca88368ad752db27.tar.gz |
png: initialize color_type to 0
Fixes
==12==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x6b8179 in setup_qt /src/qtbase/src/gui/image/qpnghandler.cpp:247:9
on fuzzed file
Change-Id: I772d536a0db91665dc16e94751ef507de1064376
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qpnghandler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index 8ae03d5d38..110ee1670b 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -234,7 +234,7 @@ void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scal png_uint_32 width; png_uint_32 height; int bit_depth; - int color_type; + int color_type = 0; png_bytep trans_alpha = 0; png_color_16p trans_color_p = 0; int num_trans; @@ -678,7 +678,7 @@ QImage::Format QPngHandlerPrivate::readImageFormat() { QImage::Format format = QImage::Format_Invalid; png_uint_32 width, height; - int bit_depth, color_type; + int bit_depth, color_type = 0; png_colorp palette; int num_palette; png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); |