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 80ce66fa55680e7ada48bc8569e16ff0143c46c7
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Tue Nov 3 04:28:58 2026 +0100
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Sun Nov 15 02:42:38 2026 +0100

    avcodec/c93: fail on truncated color tables
    
    Fixes: Ao8AXNwB2RlH
    Fixes: AISLE-2026-0150-00011
    Fixes: use of uninitialized memory
    Use of uninitialized memory Replicated through UnModified FFmpeg with MSAN
    
    Found-by: Joshua Rogers (AISLE)
    (cherry picked from commit ac0106851a4dac555c967421dfc96c0135183133)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/c93.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/libavcodec/c93.c b/libavcodec/c93.c
index da103bec40..03c007d35d 100644
--- a/libavcodec/c93.c
+++ b/libavcodec/c93.c
@@ -195,7 +195,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame 
*rframe,
                 break;
 
             case C93_8X8_2COLOR:
-                bytestream2_get_buffer(&gb, cols, 2);
+                if (bytestream2_get_buffer(&gb, cols, 2) != 2)
+                    return AVERROR_INVALIDDATA;
                 for (i = 0; i < 8; i++) {
                     draw_n_color(out + i*stride, stride, 8, 1, 1, cols,
                                      NULL, bytestream2_get_byte(&gb));
@@ -209,15 +210,18 @@ static int decode_frame(AVCodecContext *avctx, AVFrame 
*rframe,
                 for (int j = 0; j < 8; j += 4) {
                     for (i = 0; i < 8; i += 4) {
                         if (block_type == C93_4X4_2COLOR) {
-                            bytestream2_get_buffer(&gb, cols, 2);
+                            if (bytestream2_get_buffer(&gb, cols, 2) != 2)
+                                return AVERROR_INVALIDDATA;
                             draw_n_color(out + i + j*stride, stride, 4, 4,
                                     1, cols, NULL, bytestream2_get_le16(&gb));
                         } else if (block_type == C93_4X4_4COLOR) {
-                            bytestream2_get_buffer(&gb, cols, 4);
+                            if (bytestream2_get_buffer(&gb, cols, 4) != 4)
+                                return AVERROR_INVALIDDATA;
                             draw_n_color(out + i + j*stride, stride, 4, 4,
                                     2, cols, NULL, bytestream2_get_le32(&gb));
                         } else {
-                            bytestream2_get_buffer(&gb, grps, 4);
+                            if (bytestream2_get_buffer(&gb, grps, 4) != 4)
+                                return AVERROR_INVALIDDATA;
                             draw_n_color(out + i + j*stride, stride, 4, 4,
                                     1, cols, grps, bytestream2_get_le16(&gb));
                         }

-- 
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