diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-10-19 16:03:14 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-10-19 16:03:14 (GMT) |
commit | c14af1c242ea3b268a4b6a5df62869bfd0efb6c4 (patch) | |
tree | 19c8ea6930ef2def91e9f2597aceb12c4306aac6 | |
parent | 159572e52132067d74b39fb9209d72c20633bba4 (diff) | |
parent | 55c2ea18c522bd8700f43884124e02b460cdb5e2 (diff) | |
download | Qt-c14af1c242ea3b268a4b6a5df62869bfd0efb6c4.zip Qt-c14af1c242ea3b268a4b6a5df62869bfd0efb6c4.tar.gz Qt-c14af1c242ea3b268a4b6a5df62869bfd0efb6c4.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Fixes: the png_handle_cHRM crash bug in bundled libpng 1.5.4
-rw-r--r-- | src/3rdparty/libpng/pngrutil.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/3rdparty/libpng/pngrutil.c b/src/3rdparty/libpng/pngrutil.c index 07e46e2..daf3c5e 100644 --- a/src/3rdparty/libpng/pngrutil.c +++ b/src/3rdparty/libpng/pngrutil.c @@ -1037,12 +1037,14 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) */ png_uint_32 w = y_red + y_green + y_blue; - png_ptr->rgb_to_gray_red_coeff = (png_uint_16)(((png_uint_32)y_red * - 32768)/w); - png_ptr->rgb_to_gray_green_coeff = (png_uint_16)(((png_uint_32)y_green - * 32768)/w); - png_ptr->rgb_to_gray_blue_coeff = (png_uint_16)(((png_uint_32)y_blue * - 32768)/w); + if (w != 0) { + png_ptr->rgb_to_gray_red_coeff = (png_uint_16)(((png_uint_32)y_red * + 32768)/w); + png_ptr->rgb_to_gray_green_coeff = (png_uint_16)(((png_uint_32)y_green + * 32768)/w); + png_ptr->rgb_to_gray_blue_coeff = (png_uint_16)(((png_uint_32)y_blue * + 32768)/w); + } } } #endif |