diff options
author | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2015-05-09 21:30:18 -0500 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2015-05-09 21:30:18 -0500 |
commit | c1b4f50168862e62b507e2e0666c706a3c0d3c25 (patch) | |
tree | dacfabc6a7a26c36bd4ee6192d098a41bf7fba8e | |
parent | fbbd9b7723679428fecb9627b5ca2411a6e5cb7a (diff) | |
download | libpng-c1b4f50168862e62b507e2e0666c706a3c0d3c25.tar.gz |
[libpng14] Fix typecast in a png_debug2() statement in png_set_text_2() to
avoid a compiler warning in PNG_DEBUG builds.
Avoid Coverity issues 80855, 80856, and 80857 (PRINTF_ARG_MISMATCH)
in pngtest.c PNG_DEBUG builds.
-rw-r--r-- | ANNOUNCE | 4 | ||||
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | pngset.c | 6 | ||||
-rw-r--r-- | pngtest.c | 23 |
4 files changed, 23 insertions, 14 deletions
@@ -28,6 +28,10 @@ Other information: Changes since the last public release (1.4.16): version 1.4.17beta01 [May 9, 2015] + Fix typecast in a png_debug2() statement in png_set_text_2() to + avoid a compiler warning in PNG_DEBUG builds. + Avoid Coverity issues 80855, 80856, and 80857 (PRINTF_ARG_MISMATCH) + in pngtest.c PNG_DEBUG builds. Send comments/corrections/commendations to glennrp at users.sourceforge.net or to png-mng-implement at lists.sf.net (subscription required; visit @@ -2952,6 +2952,10 @@ version 1.4.16 [March 19, 2015] No changes. version 1.4.17beta01 [May 9, 2015] + Fix typecast in a png_debug2() statement in png_set_text_2() to + avoid a compiler warning in PNG_DEBUG builds. + Avoid Coverity issues 80855, 80856, and 80857 (PRINTF_ARG_MISMATCH) + in pngtest.c PNG_DEBUG builds. Send comments/corrections/commendations to glennrp at users.sourceforge.net or to png-mng-implement at lists.sf.net (subscription required; visit @@ -1,7 +1,7 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.4.15 [February 12, 2015] + * Last changed in libpng 1.4.17 [May 9, 2015] * 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.) @@ -745,10 +745,10 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr, (key_len + text_length + lang_len + lang_key_len + 4)); if (textp->key == NULL) return(1); - png_debug2(2, "Allocated %lu bytes at %x in png_set_text", + png_debug2(2, "Allocated %lu bytes at %p in png_set_text", (unsigned long)(png_uint_32) (key_len + lang_len + lang_key_len + text_length + 4), - (int)textp->key); + textp->key); png_memcpy(textp->key, text_ptr[i].key,(png_size_t)(key_len)); *(textp->key + key_len) = '\0'; @@ -1,8 +1,8 @@ /* pngtest.c - a simple test program to test libpng * - * Last changed in libpng 1.4.8 [July 7, 2011] - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Last changed in libpng 1.4.17 [May 9, 2015] + * 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.) * @@ -587,7 +587,7 @@ pngtest_debug_malloc(png_structp png_ptr, png_alloc_size_t size) /* Make sure the caller isn't assuming zeroed memory. */ png_memset(pinfo->pointer, 0xdd, pinfo->size); if (verbose) - printf("png_malloc %lu bytes at %x\n", (unsigned long)size, + printf("png_malloc %lu bytes at %p\n", (unsigned long)size, pinfo->pointer); return (png_voidp)(pinfo->pointer); } @@ -608,6 +608,7 @@ pngtest_debug_free(png_structp png_ptr, png_voidp ptr) } /* Unlink the element from the list. */ + if (pinformation != NULL) { memory_infop FAR *ppinfo = &pinformation; for (;;) @@ -628,7 +629,7 @@ pngtest_debug_free(png_structp png_ptr, png_voidp ptr) } if (pinfo->next == NULL) { - fprintf(STDERR, "Pointer %x not found\n", (unsigned int)ptr); + fprintf(STDERR, "Pointer %p not found\n", ptr); break; } ppinfo = &pinfo->next; @@ -637,7 +638,7 @@ pngtest_debug_free(png_structp png_ptr, png_voidp ptr) /* Finally free the data. */ if (verbose) - printf("Freeing %x\n", ptr); + printf("Freeing %p\n", ptr); png_free_default(png_ptr, ptr); ptr = NULL; } @@ -1242,7 +1243,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) for (y = 0; y < height; y++) { #ifndef SINGLE_ROWBUF_ALLOC - pngtest_debug2("Allocating row buffer (pass %d, y = %ld)...", pass, y); + pngtest_debug2("Allocating row buffer (pass %d, y = %u)...", pass, y); row_buf = (png_bytep)png_malloc(read_ptr, png_get_rowbytes(read_ptr, read_info_ptr)); pngtest_debug2("0x%08lx (%ld bytes)", (unsigned long)row_buf, @@ -1265,7 +1266,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) #endif /* PNG_WRITE_SUPPORTED */ #ifndef SINGLE_ROWBUF_ALLOC - pngtest_debug2("Freeing row buffer (pass %d, y = %ld)", pass, y); + pngtest_debug2("Freeing row buffer (pass %d, y = %u)", pass, y); png_free(read_ptr, row_buf); row_buf = NULL; #endif /* !SINGLE_ROWBUF_ALLOC */ @@ -1586,9 +1587,9 @@ main(int argc, char *argv[]) current_allocation); while (pinfo != NULL) { - fprintf(STDERR, " %lu bytes at %x\n", + fprintf(STDERR, " %lu bytes at %p\n", (unsigned long)pinfo->size, - (unsigned int) pinfo->pointer); + pinfo->pointer); pinfo = pinfo->next; } } @@ -1663,8 +1664,8 @@ main(int argc, char *argv[]) current_allocation); while (pinfo != NULL) { - fprintf(STDERR, " %lu bytes at %x\n", - (unsigned long)pinfo->size, (unsigned int)pinfo->pointer); + fprintf(STDERR, " %lu bytes at %p\n", + (unsigned long)pinfo->size, pinfo->pointer); pinfo = pinfo->next; } } |