mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Coverity bug fix: dead code
Also fix the previous fix attempt; the intent was to limit the calls to crc32 to ZLIB_IO_MAX, although it is not clear that this is optimal. Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
parent
714515bc0c
commit
3e46c31961
10
png.c
10
png.c
@ -140,11 +140,17 @@ png_calculate_crc(png_structrp png_ptr, png_const_bytep ptr, png_size_t length)
|
||||
|
||||
do
|
||||
{
|
||||
uInt safe_length = (uInt)length;
|
||||
uInt safe_length;
|
||||
|
||||
if (safe_length == 0)
|
||||
/* TODO: this uses ZLIB_IO_MAX which may be #defined to less than the
|
||||
* maximum of a uInt, is this the best thing to do?
|
||||
*/
|
||||
if (length > ZLIB_IO_MAX)
|
||||
safe_length = ZLIB_IO_MAX;
|
||||
|
||||
else
|
||||
safe_length = (uInt)/*SAFE*/length;
|
||||
|
||||
crc = crc32(crc, ptr, safe_length);
|
||||
|
||||
/* The following should never issue compiler warnings; if they do the
|
||||
|
Loading…
x
Reference in New Issue
Block a user