From f6e2b7db43451fe55c7d64fff99501bc4b97c656 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 2 Jun 2026 02:56:17 +0200 Subject: [PATCH] avcodec/jpeglsdec: only apply color transform to decoded rows Fixes: Timeout Fixes: 503996733/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_DEC_fuzzer-4948713016721408 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer (cherry picked from commit 3669a742dda9404af26c3ec10b6dd2237a6fa7c5) Signed-off-by: Michael Niedermayer --- libavcodec/jpeglsdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c index 5f463c9660..6b973ce330 100644 --- a/libavcodec/jpeglsdec.c +++ b/libavcodec/jpeglsdec.c @@ -495,7 +495,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, if (s->bits <= 8) { uint8_t *src = s->picture_ptr->data[0]; - for (i = 0; i < s->height; i++) { + for (i = 0; i < decoded_height; i++) { switch(s->xfrm) { case 1: for (x = off; x + 2 < w; x += 3) {