From a34a502989463aee1f08f1bd17733264df99f813 Mon Sep 17 00:00:00 2001 From: James Zern Date: Tue, 9 Jul 2013 17:33:21 -0700 Subject: [PATCH] pngdec: output error messages from libpng Change-Id: I1981562eeab2ad07eb797cea589a033943e7f21d --- examples/pngdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/pngdec.c b/examples/pngdec.c index 59e8b77d..332f6bbd 100644 --- a/examples/pngdec.c +++ b/examples/pngdec.c @@ -26,8 +26,8 @@ #include "webp/encode.h" #include "./metadata.h" -static void PNGAPI error_function(png_structp png, png_const_charp dummy) { - (void)dummy; // remove variable-unused warning +static void PNGAPI error_function(png_structp png, png_const_charp error) { + if (error != NULL) fprintf(stderr, "libpng error: %s\n", error); longjmp(png_jmpbuf(png), 1); }