Skip to content

Commit

Permalink
png: initialize color_type to 0
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tsdgeos authored and albert-astals-cid-kdab committed Jan 30, 2019
1 parent 5d885c8 commit f383fa4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/image/qpnghandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f383fa4

Please sign in to comment.