X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=contrib%2Flibtests%2Fpngimage.c;h=be176b2bc140e9af7c00addbd1ef63cd941ef835;hb=f125affdc66153880ba8dc33d8369e5a0dc9a6a7;hp=f130c043dff24a78d3b8267c6bfd5af94a771334;hpb=fa7e0fcd15b99f3b778e018992da36a5703fc6a3;p=platform%2Fupstream%2Flibpng.git diff --git a/contrib/libtests/pngimage.c b/contrib/libtests/pngimage.c index f130c04..be176b2 100644 --- a/contrib/libtests/pngimage.c +++ b/contrib/libtests/pngimage.c @@ -1,9 +1,9 @@ + /* pngimage.c * + * Copyright (c) 2021 Cosmin Truta * Copyright (c) 2015,2016 John Cunningham Bowler * - * Last changed in libpng 1.6.24 [August 4, 2016] - * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h @@ -12,6 +12,7 @@ * using png_read_png and then write with png_write_png. Test all possible * transforms. */ + #include #include #include @@ -317,11 +318,10 @@ transform_name(int t) t &= -t; /* first set bit */ - for (i=0; ibit_depth; unsigned int i; - for (i=0; iread_pp, dp->read_ip, &width, &height, &bit_depth, - &color_type, &interlace_method, &compression_method, &filter_method); + if (!png_get_IHDR(dp->read_pp, dp->read_ip, &width, &height, &bit_depth, + &color_type, &interlace_method, &compression_method, &filter_method)) + display_log(dp, LIBPNG_BUG, "png_get_IHDR failed"); # define C(item) if (item != dp->item) \ display_log(dp, APP_WARNING, "IHDR " #item "(%lu) changed to %lu",\ @@ -1081,8 +1088,9 @@ compare_read(struct display *dp, int applied_transforms) size_t x; /* Find the first error */ - for (x=0; x 0x%.2x", @@ -1137,6 +1145,7 @@ compare_read(struct display *dp, int applied_transforms) display_log(dp, LIBPNG_ERROR, "invalid colour type %d", color_type); /*NOTREACHED*/ + memset(sig_bits, 0, sizeof(sig_bits)); bpp = 0; break; } @@ -1198,7 +1207,7 @@ compare_read(struct display *dp, int applied_transforms) sig_bits[0] = (png_byte)b; break; - case 4: /* Relicate twice */ + case 4: /* Replicate twice */ /* Value is 1, 2, 3 or 4 */ b = 0xf & ((0xf << 4) >> sig_bits[0]); b |= b << 4; @@ -1686,8 +1695,9 @@ main(int argc, char **argv) printf("%s: pngimage ", pass ? "PASS" : "FAIL"); - for (j=1; j