summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/libpng/pngread.c
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@theqtcompany.com>2015-12-07 14:53:22 +0100
committerJoerg Bornemann <joerg.bornemann@theqtcompany.com>2015-12-17 09:25:56 +0000
commitad5c768fc8b93e22201fb557561b2edd4fcdc26b (patch)
tree437f6d12153190e3f58e5e8524900fe0b204daf7 /src/3rdparty/libpng/pngread.c
parenta88da6377da2e10998574ccc709bec014e2b75a5 (diff)
Update bundled libpng to version 1.6.19
Merged in the upstream version, which obsoleted some local patches. The remaining diff to clean 1.6.19 is archived in the qtpatches.diff file. Change-Id: I676df2dab2c52c7fe576de284d472d70206f0a8c Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
Diffstat (limited to 'src/3rdparty/libpng/pngread.c')
-rw-r--r--src/3rdparty/libpng/pngread.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/3rdparty/libpng/pngread.c b/src/3rdparty/libpng/pngread.c
index 6764dbe561..48aae84881 100644
--- a/src/3rdparty/libpng/pngread.c
+++ b/src/3rdparty/libpng/pngread.c
@@ -63,7 +63,7 @@ png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
/* In stable builds only warn if an application error can be completely
* handled.
*/
-# if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC
+# if PNG_RELEASE_BUILD
png_ptr->flags |= PNG_FLAG_APP_WARNINGS_WARN;
# endif
# endif
@@ -1043,9 +1043,9 @@ png_read_png(png_structrp png_ptr, png_inforp info_ptr,
/* Tell libpng to strip 16-bit/color files down to 8 bits per color.
*/
if ((transforms & PNG_TRANSFORM_SCALE_16) != 0)
- /* Added at libpng-1.5.4. "strip_16" produces the same result that it
- * did in earlier versions, while "scale_16" is now more accurate.
- */
+ /* Added at libpng-1.5.4. "strip_16" produces the same result that it
+ * did in earlier versions, while "scale_16" is now more accurate.
+ */
#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
png_set_scale_16(png_ptr);
#else
@@ -1209,7 +1209,7 @@ png_read_png(png_structrp png_ptr, png_inforp info_ptr,
for (iptr = 0; iptr < info_ptr->height; iptr++)
info_ptr->row_pointers[iptr] = png_voidcast(png_bytep,
- png_malloc(png_ptr, info_ptr->rowbytes));
+ png_malloc(png_ptr, info_ptr->rowbytes));
}
png_read_image(png_ptr, info_ptr->row_pointers);
@@ -1683,10 +1683,11 @@ decode_gamma(png_image_read_control *display, png_uint_32 value, int encoding)
value *= 257;
break;
+#ifdef __GNUC__
default:
png_error(display->image->opaque->png_ptr,
"unexpected encoding (internal error)");
- break;
+#endif
}
return value;
@@ -2847,10 +2848,6 @@ png_image_read_colormap(png_voidp argument)
switch (data_encoding)
{
- default:
- png_error(png_ptr, "bad data option (internal error)");
- break;
-
case P_sRGB:
/* Change to 8-bit sRGB */
png_set_alpha_mode_fixed(png_ptr, PNG_ALPHA_PNG, PNG_GAMMA_sRGB);
@@ -2860,6 +2857,11 @@ png_image_read_colormap(png_voidp argument)
if (png_ptr->bit_depth > 8)
png_set_scale_16(png_ptr);
break;
+
+#ifdef __GNUC__
+ default:
+ png_error(png_ptr, "bad data option (internal error)");
+#endif
}
if (cmap_entries > 256 || cmap_entries > image->colormap_entries)
@@ -3410,10 +3412,6 @@ png_image_read_background(png_voidp argument)
*/
switch (info_ptr->bit_depth)
{
- default:
- png_error(png_ptr, "unexpected bit depth");
- break;
-
case 8:
/* 8-bit sRGB gray values with an alpha channel; the alpha channel is
* to be removed by composing on a background: either the row if
@@ -3631,6 +3629,11 @@ png_image_read_background(png_voidp argument)
}
}
break;
+
+#ifdef __GNUC__
+ default:
+ png_error(png_ptr, "unexpected bit depth");
+#endif
}
return 1;