From 6a245e71427abcb92b358eeb21ba4bf3c89cbf00 Mon Sep 17 00:00:00 2001 From: Colin Leroy-Mira Date: Mon, 17 Aug 2026 11:22:39 +0200 Subject: [PATCH] Ignore unsupported quantization tables when we won't use them --- picojpeg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/picojpeg.c b/picojpeg.c index 2fae2a9..6cba8a5 100644 --- a/picojpeg.c +++ b/picojpeg.c @@ -642,8 +642,9 @@ static uint8 readSOFMarker(void) gCompVSamp[i] = (uint8)getBits1(4); gCompQuant[i] = (uint8)getBits1(8); - if (gCompQuant[i] > 1) + if (i < 2 && gCompQuant[i] > 1) { return PJPG_UNSUPPORTED_QUANT_TABLE; + } } return 0;