[libpng17] Implemented assert support and usage.

This commit is contained in:
John Bowler
2015-03-20 16:39:56 -05:00
committed by Glenn Randers-Pehrson
parent e8e7b6681e
commit 2460d9494d
20 changed files with 336 additions and 50 deletions

View File

@@ -17,6 +17,7 @@
*/
#include "pngpriv.h"
#define PNG_SRC_FILE PNG_SRC_FILE_pngrtran
#ifdef PNG_READ_SUPPORTED
@@ -1271,11 +1272,8 @@ png_init_background_transformations(png_structrp png_ptr)
* than the libpng required depth scale the values back to the 8-bit
* range, the test below verifies that this is correct.
*/
if (bit_depth > required_bit_depth)
{
if (bit_depth != 16 || required_bit_depth != 8)
png_error(png_ptr, "internal error handling background depth");
}
assert(bit_depth <= required_bit_depth ||
(bit_depth == 16 && required_bit_depth == 8));
if ((color_type & PNG_COLOR_MASK_COLOR) != 0)
{