From d06a3d89a455625cddec47f20cb7a4ef8ea60904 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 6 Jan 2016 16:59:07 +0100 Subject: Fix conditional jump or move depends on uninitialised value. stm.avail_out is only set if !only_metadata. Reverse the order of the if tests to silence valgrind. --- source/fitz/load-png.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/fitz/load-png.c') diff --git a/source/fitz/load-png.c b/source/fitz/load-png.c index 956827c0..41529f22 100644 --- a/source/fitz/load-png.c +++ b/source/fitz/load-png.c @@ -454,7 +454,7 @@ png_read_image(fz_context *ctx, struct info *info, unsigned char *p, unsigned in p += size + 12; total -= size + 12; } - if (stm.avail_out != 0 && !only_metadata) + if (!only_metadata && stm.avail_out != 0) { memset(stm.next_out, 0xff, stm.avail_out); fz_warn(ctx, "missing pixel data in png image; possibly truncated"); -- cgit v1.2.3