From 0f086e044da1aa5250be6934cd9adb582065c691 Mon Sep 17 00:00:00 2001 From: Eric Smith Date: Thu, 28 Apr 2022 20:38:57 -0600 Subject: [PATCH] Init height and width to avoid warnings. --- tumble_png.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tumble_png.c b/tumble_png.c index d60051d..c99f232 100644 --- a/tumble_png.c +++ b/tumble_png.c @@ -88,10 +88,16 @@ static bool get_png_image_info (int image, input_attributes_t input_attributes, image_info_t *image_info) { - uint8_t buf [20], unit; - uint32_t width,height,xppu,yppu; + uint8_t buf [20]; + uint8_t unit; + uint32_t width = 0; // compiler isn't smart enough to tell that there's + uint32_t height = 0; // no way past the for(;;) loop that doesn't init these + uint32_t xppu; + uint32_t yppu; size_t l; - bool seen_IHDR,seen_PLTE,seen_pHYs; + bool seen_IHDR; + bool seen_PLTE; + bool seen_pHYs; seen_IHDR=seen_PLTE=seen_pHYs=false; memset(&cinfo,0,sizeof(cinfo));