[lipng17] Do not build png_product2() when it is unused and work around

one more Coverity-scan dead-code warning.
This commit is contained in:
Glenn Randers-Pehrson
2015-02-07 08:54:07 -06:00
parent d7312be749
commit 6ce2d220b4
5 changed files with 45 additions and 39 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