[libpng16] Do not build png_product2() when it is unused.

Work around more Coverity-scan dead-code warnings.
This commit is contained in:
Glenn Randers-Pehrson
2015-02-07 09:03:30 -06:00
parent 8f0e2729dd
commit 8cd78da8b3
7 changed files with 49 additions and 27 deletions

View File

@@ -2285,8 +2285,14 @@ png_image_read_colormap(png_voidp argument)
output_processing = PNG_CMAP_NONE;
break;
}
#ifdef __COVERITY__
/* Coverity claims that output_encoding cannot be 2 (P_LINEAR)
* here.
*/
back_alpha = 255;
#else
back_alpha = output_encoding == P_LINEAR ? 65535 : 255;
#endif
}
/* output_processing means that the libpng-processed row will be
@@ -2411,7 +2417,14 @@ png_image_read_colormap(png_voidp argument)
*/
background_index = i;
png_create_colormap_entry(display, i++, back_r, back_g, back_b,
output_encoding == P_LINEAR ? 65535U : 255U, output_encoding);
#ifdef __COVERITY__
/* Coverity claims that output_encoding cannot be 2 (P_LINEAR)
* here.
*/ 255U,
#else
output_encoding == P_LINEAR ? 65535U : 255U,
#endif
output_encoding);
/* For non-opaque input composite on the sRGB background - this
* requires inverting the encoding for each component. The input