summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@edeltech.ch>2013-09-19 07:13:25 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-20 13:41:32 (GMT)
commitb12a8d47ba8a803cae88718249b8d3f7d4a85948 (patch)
tree36793626c12ead25e26734e59301877e2ce53311 /src/gui/image
parenteb39bd7ad04a0e960f432392f6e99ac25b27c6f7 (diff)
downloadQt-b12a8d47ba8a803cae88718249b8d3f7d4a85948.zip
Qt-b12a8d47ba8a803cae88718249b8d3f7d4a85948.tar.gz
Qt-b12a8d47ba8a803cae88718249b8d3f7d4a85948.tar.bz2
Add missing variables initialization before requesting png offset
Initialize all values read to sensible default in case reading them fails. Qt 5 fix commit 0ab3e290c4808f73d46903a5274929e3833d8d3c Task-number: QTBUG-32674 Change-Id: I3a120b5673b67f705a4ebec4359aa52e2392492a Reviewed-by: aavit <eirik.aavitsland@digia.com>
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qpnghandler.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp
index ac78610..e942f4a 100644
--- a/src/gui/image/qpnghandler.cpp
+++ b/src/gui/image/qpnghandler.cpp
@@ -490,13 +490,13 @@ bool Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngImage(QImage *outImage)
return false;
}
- 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);