diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-08-28 12:20:17 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-30 09:58:04 +0200 |
commit | 0ab3e290c4808f73d46903a5274929e3833d8d3c (patch) | |
tree | 33da1df923ca33510592ec1d6b0abf1bc19d93a0 | |
parent | b49327145eb984c2051585d89f0826c58d35c116 (diff) |
Initialize variables to fix valgrind warning in pnghandler.
Conditional jump or move depends on uninitialised value(s)
==7986== at 0x5B838E8: QPngHandlerPrivate::readPngImage(QImage*)
(qpnghandler.cpp:617)
Change-Id: Ie739ca1665ce600426e2816a6229145d814125cb
Reviewed-by: aavit <eirik.aavitsland@digia.com>
-rw-r--r-- | src/gui/image/qpnghandler.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index e43ac666c7..7838b7df8e 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -591,14 +591,14 @@ bool Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngImage(QImage *outImage) if (doScaledRead) { read_image_scaled(outImage, png_ptr, info_ptr, amp, scaledSize); } else { - png_uint_32 width; - png_uint_32 height; - png_int_32 offset_x; - png_int_32 offset_y; - - int bit_depth; - int color_type; - int unit_type; + png_uint_32 width = 0; + png_uint_32 height = 0; + png_int_32 offset_x = 0; + png_int_32 offset_y = 0; + + int bit_depth = 0; + int color_type = 0; + int unit_type = PNG_OFFSET_PIXEL; png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); png_get_oFFs(png_ptr, info_ptr, &offset_x, &offset_y, &unit_type); uchar *data = outImage->bits(); |