From 09e74272599d760aaafe55edbf38fda911e16acc Mon Sep 17 00:00:00 2001 From: gitlost Date: Thu, 11 Mar 2021 11:59:30 +0000 Subject: [PATCH] png.c: suppress clobbered warning by moving init of vars from stack --- backend/png.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/png.c b/backend/png.c index b8f472ac..cf8a2377 100644 --- a/backend/png.c +++ b/backend/png.c @@ -101,9 +101,9 @@ INTERNAL int png_pixel_plot(struct zint_symbol *symbol, unsigned char *pixelbuf) unsigned char bg_alpha, fg_alpha; unsigned char map[128]; png_color palette[32]; - int num_palette = 0; + int num_palette; unsigned char trans_alpha[32]; - int num_trans = 0; + int num_trans; int bit_depth; int compression_strategy; unsigned char *pb; @@ -138,6 +138,7 @@ INTERNAL int png_pixel_plot(struct zint_symbol *symbol, unsigned char *pixelbuf) bg_alpha = 0xff; } + num_palette = num_trans = 0; if (symbol->symbology == BARCODE_ULTRA) { static const int ultra_chars[8] = { 'W', 'C', 'B', 'M', 'R', 'Y', 'G', 'K' }; static png_color ultra_colours[8] = {