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

Git pushed a commit to branch master
in repository ffmpeg.

commit cf8e0c40b60b563ba2addf1dcb4fe3557143ab17
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Wed Nov 11 15:24:55 2026 +0100
Commit:     michaelni <[email protected]>
CommitDate: Fri Nov 13 22:55:54 2026 +0000

    avcodec/microdvddec: do not read the default tags beyond the extradata
    
    Fixes: out of array read
    Fixes: MSrIa2a0IU4Q
    
    Found during triage of the review of 
https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25134
    
    Out of array read Replicated through API with ASAN
---
 libavcodec/microdvddec.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavcodec/microdvddec.c b/libavcodec/microdvddec.c
index 95f0166bf4..4215f1e20b 100644
--- a/libavcodec/microdvddec.c
+++ b/libavcodec/microdvddec.c
@@ -28,6 +28,7 @@
 
 #include "libavutil/attributes.h"
 #include "libavutil/avstring.h"
+#include "libavutil/mem.h"
 #include "libavutil/parseutils.h"
 #include "libavutil/bprint.h"
 #include "avcodec.h"
@@ -342,7 +343,11 @@ static av_cold int microdvd_init(AVCodecContext *avctx)
     av_bprintf(&font_buf, "%s", ASS_DEFAULT_FONT);
 
     if (avctx->extradata) {
-        microdvd_load_tags(tags, avctx->extradata);
+        char *default_tags = av_strndup(avctx->extradata, 
avctx->extradata_size);
+
+        if (!default_tags)
+            return AVERROR(ENOMEM);
+        microdvd_load_tags(tags, default_tags);
         for (i = 0; i < sizeof(MICRODVD_TAGS) - 1; i++) {
             switch (av_tolower(tags[i].key)) {
             case 'y':
@@ -368,6 +373,7 @@ static av_cold int microdvd_init(AVCodecContext *avctx)
                 break;
             }
         }
+        av_free(default_tags);
     }
     return ff_ass_subtitle_header(avctx, font_buf.str, font_size, color,
                                   ASS_DEFAULT_BACK_COLOR, bold, italic,

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