[libpng16] Removed one of the GCC-7.1.0 'strict-overflow' warnings that

result when integers appear on both sides of a compare.  Worked around the
  others by forcing the strict-overflow setting in the relevant functions to
  a level where they are not reported.
Changed "FALL THROUGH" comments to "FALLTHROUGH" because GCC doesn't like
  the space.
Worked around some C-style casts from (void*) because g++ 5.4.0 objects
  to them.
Increased the buffer size for 'sprint' to pass the gcc 7.1.0 'sprint
  overflow' check that is on by default with -Wall -Wextra.
This commit is contained in:
John Bowler
2017-07-11 07:50:35 -05:00
committed by Glenn Randers-Pehrson
parent ecea632c4c
commit 72d07d3202
13 changed files with 124 additions and 60 deletions

View File

@@ -1,8 +1,7 @@
/* pngfix.c
*
* Copyright (c) 2014-2016 John Cunningham Bowler
*
* Last changed in libpng 1.6.26 [October 20, 2016]
* Last changed in libpng 1.6.31 [(PENDING RELEASE)]
* Copyright (c) 2014-2017 John Cunningham Bowler
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -2416,7 +2415,7 @@ zlib_advance(struct zlib *zlib, png_uint_32 nbytes)
endrc = ZLIB_TOO_FAR_BACK;
break;
}
/* FALL THROUGH */
/* FALLTHROUGH */
default:
zlib_message(zlib, 0/*stream error*/);
@@ -2570,7 +2569,7 @@ zlib_run(struct zlib *zlib)
list->lengths[i] -= zlib->extra_bytes;
list->count = i+1;
zlib->idat->idat_list_tail = list;
/* FALL THROUGH */
/* FALLTHROUGH */
default:
return rc;
@@ -2673,7 +2672,7 @@ zlib_check(struct file *file, png_uint_32 offset)
/* Truncated stream; unrecoverable, gets converted to ZLIB_FATAL */
zlib.z.msg = PNGZ_MSG_CAST("[truncated]");
zlib_message(&zlib, 0/*expected*/);
/* FALL THROUGH */
/* FALLTHROUGH */
default:
/* Unrecoverable error; skip the chunk; a zlib_message has already
@@ -3341,7 +3340,7 @@ read_callback(png_structp png_ptr, png_bytep buffer, size_t count)
if (file->state != STATE_IDAT && length > 0)
setpos(chunk);
}
/* FALL THROUGH */
/* FALLTHROUGH */
default:
assert(chunk != NULL);