mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng16] Removed unreachable "break" statements in png.c, pngread.c, and
pngrtran.c to suppress clang warnings (Bug report by Viktor Szakats).
This commit is contained in:
committed by
Glenn Randers-Pehrson
parent
0e9cd91609
commit
4e1d299e6b
19
pngread.c
19
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;
|
||||
|
||||
Reference in New Issue
Block a user