From 86ec52310379f2cc74250577da0244a88d033faf Mon Sep 17 00:00:00 2001 From: panzhe Date: Tue, 13 Oct 2026 11:52:40 +0800 Subject: [PATCH] qrenc: fix crash when PNG32 output is requested without -o The outfile == NULL check only covered PNG_TYPE, so "qrenc -t PNG32" without -o passed NULL to writePNG(), which dereferences it. Check PNG32_TYPE as well. --- qrenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qrenc.c b/qrenc.c index c09c4ab6..55424bd4 100644 --- a/qrenc.c +++ b/qrenc.c @@ -1397,7 +1397,7 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } - if(outfile == NULL && image_type == PNG_TYPE) { + if(outfile == NULL && (image_type == PNG_TYPE || image_type == PNG32_TYPE)) { fprintf(stderr, "No output filename is given.\n"); exit(EXIT_FAILURE); }