summaryrefslogtreecommitdiff
path: root/pngread.c
diff options
context:
space:
mode:
authorVictor Szakats <vszakats@github.com>2015-08-07 14:31:11 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2015-08-07 14:31:11 -0500
commit4e1d299e6b6ca5fc6453531c69b29e8d9e186668 (patch)
tree986f7075a4a3161f9529abd18143c1c8e5485ab6 /pngread.c
parent0e9cd9160970c2fa519c872036f8d309efa231c9 (diff)
downloadlibpng-4e1d299e6b6ca5fc6453531c69b29e8d9e186668.tar.gz
[libpng16] Removed unreachable "break" statements in png.c, pngread.c, and
pngrtran.c to suppress clang warnings (Bug report by Viktor Szakats).
Diffstat (limited to 'pngread.c')
-rw-r--r--pngread.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/pngread.c b/pngread.c
index e88151c20..9cc5510dd 100644
--- a/pngread.c
+++ b/pngread.c
@@ -1683,10 +1683,11 @@ decode_gamma(png_image_read_control *display, png_uint_32 value, int encoding)
value *= 257;
break;
+#ifdef PNG_DEBUG
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 PNG_DEBUG
+ 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,9 @@ png_image_read_background(png_voidp argument)
}
}
break;
+
+ default:
+ png_error(png_ptr, "unexpected bit depth");
}
return 1;