This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch release/9.1
in repository ffmpeg.

commit bbf8ffe7f925a260ead40795432976f92a0027b5
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Wed Nov 11 05:09:41 2026 +0100
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Sun Nov 15 21:19:57 2026 +0100

    avcodec/mjpegdec: reject lossless RCT scans that do not code all components
    
    Fixes: use of uninitialized memory
    Fixes: fFQc8EgXP8v9
    
    Found during the triage of a finding from the review of 
https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25034
    
    Use of uninitialized memory Replicated through UnModified FFmpeg with 
Valgrind
    
    (cherry picked from commit 51fc17901a3b0252f1cbe02c84bacf91b7ab412a)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/mjpegdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index df46b2b8dc..caa6b9d1d9 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1120,6 +1120,8 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s)
         if (s->rct || s->pegasus_rct)
             return AVERROR_INVALIDDATA;
     }
+    if ((s->rct || s->pegasus_rct) && nb_components != s->nb_components)
+        return AVERROR_INVALIDDATA;
 
     av_fast_malloc(&s->ljpeg_buffer, &s->ljpeg_buffer_size,
                    (unsigned)s->mb_width * 4 * sizeof(s->ljpeg_buffer[0][0]));

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to