Revert "[libpng16] Quieted about 100 warnings from clang-3.8 in pngtrans.c, pngread.c,"

This reverts commit 97dfccb6325e54d45c4440b6dd037619d88688cc.
This commit is contained in:
Glenn Randers-Pehrson 2016-09-30 21:34:21 -05:00
parent 97dfccb632
commit b5b77a72b4
6 changed files with 21 additions and 24 deletions

View File

@ -1,4 +1,4 @@
Libpng 1.6.26beta02 - October 1, 2016 Libpng 1.6.26beta02 - September 30, 2016
This is not intended to be a public release. It will be replaced This is not intended to be a public release. It will be replaced
within a few weeks by a public version or by another test version. within a few weeks by a public version or by another test version.
@ -41,10 +41,9 @@ Version 1.6.26beta01 [September 26, 2016]
Add tests/badcrc.png and tests/badadler.png to tests/pngtest. Add tests/badcrc.png and tests/badadler.png to tests/pngtest.
Merged pngtest.c with libpng-1.7.0beta84/pngtest.c Merged pngtest.c with libpng-1.7.0beta84/pngtest.c
Version 1.6.26beta02 [October 1, 2016] Version 1.6.26beta02 [September 30, 2016]
Updated the documentation about CRC and ADLER32 handling. Updated the documentation about CRC and ADLER32 handling.
Quieted about 100 warnings from clang-3.8 in pngtrans.c, pngread.c, Quieted a warning from clang-3.8 in pngtrans.c.
pngwrite.c, pngunknown.c, and pngvalid.c.
Quieted 116 (out of 288) -Wconversion compiler warnings by changing Quieted 116 (out of 288) -Wconversion compiler warnings by changing
flag definitions in pngpriv.h from 0xnnnn to 0xnnnnU and trivial changes flag definitions in pngpriv.h from 0xnnnn to 0xnnnnU and trivial changes
in png.c, pngread.c, and pngwutil.c. in png.c, pngread.c, and pngwutil.c.

View File

@ -5719,10 +5719,9 @@ Version 1.6.26beta01 [September 26, 2016]
Add tests/badcrc.png and tests/badadler.png to tests/pngtest. Add tests/badcrc.png and tests/badadler.png to tests/pngtest.
Merged pngtest.c with libpng-1.7.0beta84/pngtest.c Merged pngtest.c with libpng-1.7.0beta84/pngtest.c
Version 1.6.26beta02 [October 1, 2016] Version 1.6.26beta02 [September 30, 2016]
Updated the documentation about CRC and ADLER32 handling. Updated the documentation about CRC and ADLER32 handling.
Quieted about 100 warnings from clang-3.8 in pngtrans.c, pngread.c, Quieted a warning from clang-3.8 in pngtrans.c.
pngwrite.c, pngunknown.c, and pngvalid.c.
Quieted 116 (out of 288) -Wconversion compiler warnings by changing Quieted 116 (out of 288) -Wconversion compiler warnings by changing
flag definitions in pngpriv.h from 0xnnnn to 0xnnnnU and trivial changes flag definitions in pngpriv.h from 0xnnnn to 0xnnnnU and trivial changes
in png.c, pngread.c, and pngwutil.c. in png.c, pngread.c, and pngwutil.c.

View File

@ -476,9 +476,9 @@ get_valid(display *d, png_infop info_ptr)
/* Map the text chunks back into the flags */ /* Map the text chunks back into the flags */
{ {
png_textp text; png_textp text;
png_uint_32 ntext = png_get_text(d->png_ptr, info_ptr, &text, NULL) + 1; png_uint_32 ntext = png_get_text(d->png_ptr, info_ptr, &text, NULL);
while (ntext-- > 1) switch (text[ntext - 1].compression) while (ntext-- > 0) switch (text[ntext].compression)
{ {
case -1: case -1:
flags |= PNG_INFO_tEXt; flags |= PNG_INFO_tEXt;
@ -492,7 +492,7 @@ get_valid(display *d, png_infop info_ptr)
break; break;
default: default:
fprintf(stderr, "%s(%s): unknown text compression %d\n", d->file, fprintf(stderr, "%s(%s): unknown text compression %d\n", d->file,
d->test, text[ntext - 1].compression); d->test, text[ntext].compression);
display_exit(d); display_exit(d);
} }
} }

View File

@ -1236,13 +1236,13 @@ store_image_check(const png_store* ps, png_const_structp pp, int iImage)
else else
{ {
png_size_t cbRow = ps->cb_row; png_size_t cbRow = ps->cb_row;
png_uint_32 rows = ps->image_h + 1; png_uint_32 rows = ps->image_h;
image += iImage * (cbRow+5) * ps->image_h; image += iImage * (cbRow+5) * ps->image_h;
image += 2; /* skip image first row markers */ image += 2; /* skip image first row markers */
while (rows-- > 1) while (rows-- > 0)
{ {
if (image[-2] != 190 || image[-1] != 239) if (image[-2] != 190 || image[-1] != 239)
png_error(pp, "row start overwritten"); png_error(pp, "row start overwritten");
@ -11382,7 +11382,6 @@ perform_interlace_macro_validation(void)
for (pass=0; pass<7; ++pass) for (pass=0; pass<7; ++pass)
{ {
/* TO DO: Check this: asan says png_uint_32 is not large enough */
png_uint_32 m, f, v; png_uint_32 m, f, v;
m = PNG_PASS_START_ROW(pass); m = PNG_PASS_START_ROW(pass);

View File

@ -3228,10 +3228,10 @@ png_image_read_colormapped(png_voidp argument)
while (--passes >= 0) while (--passes >= 0)
{ {
png_uint_32 y = image->height + 1; png_uint_32 y = image->height;
png_bytep row = png_voidcast(png_bytep, display->first_row); png_bytep row = png_voidcast(png_bytep, display->first_row);
while (y-- > 1) while (y-- > 0)
{ {
png_read_row(png_ptr, row, NULL); png_read_row(png_ptr, row, NULL);
row += row_bytes; row += row_bytes;
@ -4061,10 +4061,10 @@ png_image_read_direct(png_voidp argument)
while (--passes >= 0) while (--passes >= 0)
{ {
png_uint_32 y = image->height + 1; png_uint_32 y = image->height;
png_bytep row = png_voidcast(png_bytep, display->first_row); png_bytep row = png_voidcast(png_bytep, display->first_row);
while (y-- > 1) while (y-- > 0)
{ {
png_read_row(png_ptr, row, NULL); png_read_row(png_ptr, row, NULL);
row += row_bytes; row += row_bytes;

View File

@ -1527,7 +1527,7 @@ png_write_image_16bit(png_voidp argument)
png_uint_16p row_end; png_uint_16p row_end;
const int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ? 3 : 1; const int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ? 3 : 1;
int aindex = 0; int aindex = 0;
png_uint_32 y = image->height + 1; png_uint_32 y = image->height;
if ((image->format & PNG_FORMAT_FLAG_ALPHA) != 0) if ((image->format & PNG_FORMAT_FLAG_ALPHA) != 0)
{ {
@ -1554,7 +1554,7 @@ png_write_image_16bit(png_voidp argument)
*/ */
row_end = output_row + image->width * (channels+1); row_end = output_row + image->width * (channels+1);
while (y-- > 1) while (y-- > 0)
{ {
png_const_uint_16p in_ptr = input_row; png_const_uint_16p in_ptr = input_row;
png_uint_16p out_ptr = output_row; png_uint_16p out_ptr = output_row;
@ -1682,7 +1682,7 @@ png_write_image_8bit(png_voidp argument)
png_const_uint_16p input_row = png_voidcast(png_const_uint_16p, png_const_uint_16p input_row = png_voidcast(png_const_uint_16p,
display->first_row); display->first_row);
png_bytep output_row = png_voidcast(png_bytep, display->local_row); png_bytep output_row = png_voidcast(png_bytep, display->local_row);
png_uint_32 y = image->height + 1; png_uint_32 y = image->height;
const int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ? 3 : 1; const int channels = (image->format & PNG_FORMAT_FLAG_COLOR) != 0 ? 3 : 1;
if ((image->format & PNG_FORMAT_FLAG_ALPHA) != 0) if ((image->format & PNG_FORMAT_FLAG_ALPHA) != 0)
@ -1705,7 +1705,7 @@ png_write_image_8bit(png_voidp argument)
/* Use row_end in place of a loop counter: */ /* Use row_end in place of a loop counter: */
row_end = output_row + image->width * (channels+1); row_end = output_row + image->width * (channels+1);
while (y-- > 1) while (y-- > 0)
{ {
png_const_uint_16p in_ptr = input_row; png_const_uint_16p in_ptr = input_row;
png_bytep out_ptr = output_row; png_bytep out_ptr = output_row;
@ -1746,7 +1746,7 @@ png_write_image_8bit(png_voidp argument)
*/ */
png_bytep row_end = output_row + image->width * channels; png_bytep row_end = output_row + image->width * channels;
while (y-- > 1) while (y-- > 0)
{ {
png_const_uint_16p in_ptr = input_row; png_const_uint_16p in_ptr = input_row;
png_bytep out_ptr = output_row; png_bytep out_ptr = output_row;
@ -2134,9 +2134,9 @@ png_image_write_main(png_voidp argument)
{ {
png_const_bytep row = png_voidcast(png_const_bytep, display->first_row); png_const_bytep row = png_voidcast(png_const_bytep, display->first_row);
ptrdiff_t row_bytes = display->row_bytes; ptrdiff_t row_bytes = display->row_bytes;
png_uint_32 y = image->height + 1; png_uint_32 y = image->height;
while (y-- > 1) while (y-- > 0)
{ {
png_write_row(png_ptr, row); png_write_row(png_ptr, row);
row += row_bytes; row += row_bytes;