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

Git pushed a commit to branch master
in repository ffmpeg.

commit 1eaaa6c60c4dc3366e876dad7fa6a4b38c6ff62e
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Sun Oct 11 07:31:13 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Mon Oct 12 21:18:53 2026 +0000

    avcodec/tdsc: reject unknown cursor formats before replacing the cursor 
sprite
    
    The sprite buffer was reallocated and the new geometry stored before the
    format was checked, the uninitialized sprite was then painted onto every
    following frame.
    
    Fixes: use of uninitialized memory
    Fixes: JJihVQxE36RL
    Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24682
    Use of uninitialized memory Replicated through UnModified FFmpeg with 
Valgrind
---
 libavcodec/tdsc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavcodec/tdsc.c b/libavcodec/tdsc.c
index f31655ce3d..976b67b8f9 100644
--- a/libavcodec/tdsc.c
+++ b/libavcodec/tdsc.c
@@ -209,6 +209,11 @@ static int tdsc_load_cursor(AVCodecContext *avctx)
 
     cursor_fmt = bytestream2_get_le32(&ctx->gbc);
 
+    if (cursor_fmt != CUR_FMT_MONO && cursor_fmt != CUR_FMT_BGRA &&
+        cursor_fmt != CUR_FMT_RGBA) {
+        avpriv_request_sample(avctx, "Cursor format %08x", cursor_fmt);
+        return AVERROR_PATCHWELCOME;
+    }
     if (w < 1 || w > 256 || h < 1 || h > 256) {
         av_log(avctx, AV_LOG_ERROR, "Invalid cursor dimensions %dx%d.\n", w, 
h);
         return AVERROR_INVALIDDATA;
@@ -305,9 +310,6 @@ static int tdsc_load_cursor(AVCodecContext *avctx)
             }
         }
         break;
-    default:
-        avpriv_request_sample(avctx, "Cursor format %08x", cursor_fmt);
-        return AVERROR_PATCHWELCOME;
     }
 
     return 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