[libpng12] Quieted some harmless warnings from Coverity-scan.

This commit is contained in:
Glenn Randers-Pehrson
2015-01-31 13:54:10 -06:00
parent a4d40f32dd
commit e0e239ada0
9 changed files with 71 additions and 37 deletions

View File

@@ -1,8 +1,8 @@
/* pngrutil.c - utilities to read a PNG file
*
* Last changed in libpng 1.2.51 [February 6, 2014]
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
* Last changed in libpng 1.2.53 [%RDATE%]
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -60,7 +60,7 @@ png_get_uint_31(png_structp png_ptr, png_bytep buf)
png_uint_32 i = ((png_uint_32)(*buf) << 24) +
((png_uint_32)(*(buf + 1)) << 16) +
((png_uint_32)(*(buf + 2)) << 8) +
(png_uint_32)(*(buf + 3));
((png_uint_32)(*(buf + 3)) );
#endif
if (i > PNG_UINT_31_MAX)
png_error(png_ptr, "PNG unsigned integer out of range.");
@@ -294,12 +294,15 @@ png_inflate(png_structp png_ptr, const png_byte *data, png_size_t size,
png_snprintf(umsg, sizeof umsg, msg, png_ptr->chunk_name);
msg = umsg;
png_warning(png_ptr, msg);
#else
msg = "Damaged compressed datastream in chunk other than IDAT";
#endif
}
#ifndef PNG_STDIO_SUPPORTED
png_warning(png_ptr, msg);
#endif
}
/* 0 means an error - notice that this code simple ignores
@@ -1130,10 +1133,10 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
/* Check the profile_size recorded in the first 32 bits of the ICC profile */
pC = (png_bytep)(png_ptr->chunkdata + prefix_length);
profile_size = ((*(pC ))<<24) |
((*(pC + 1))<<16) |
((*(pC + 2))<< 8) |
((*(pC + 3)) );
profile_size = ((png_uint_32) (*(pC )<<24)) |
((png_uint_32) (*(pC + 1)<<16)) |
((png_uint_32) (*(pC + 2)<< 8)) |
((png_uint_32) (*(pC + 3) ));
if (profile_size < profile_length)
profile_length = profile_size;
@@ -2714,7 +2717,9 @@ png_do_read_interlace(png_structp png_ptr)
png_uint_32 transformations = png_ptr->transformations;
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
/* Offset to next interlace block */
#ifndef PNG_USE_GLOBAL_ARRAYS
PNG_CONST int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
#endif
png_debug(1, "in png_do_read_interlace");
if (row != NULL && row_info != NULL)
@@ -3054,6 +3059,7 @@ void /* PRIVATE */
png_read_finish_row(png_structp png_ptr)
{
#ifdef PNG_READ_INTERLACING_SUPPORTED
#ifndef PNG_USE_GLOBAL_ARRAYS
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
/* Start of interlace block */
@@ -3067,6 +3073,7 @@ png_read_finish_row(png_structp png_ptr)
/* Offset to next interlace block in the y direction */
PNG_CONST int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
#endif
#endif /* PNG_READ_INTERLACING_SUPPORTED */
png_debug(1, "in png_read_finish_row");
@@ -3182,6 +3189,7 @@ void /* PRIVATE */
png_read_start_row(png_structp png_ptr)
{
#ifdef PNG_READ_INTERLACING_SUPPORTED
#ifndef PNG_USE_GLOBAL_ARRAYS
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
/* Start of interlace block */
@@ -3195,6 +3203,7 @@ png_read_start_row(png_structp png_ptr)
/* Offset to next interlace block in the y direction */
PNG_CONST int png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
#endif
#endif
int max_pixel_depth;