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

Git pushed a commit to branch master
in repository ffmpeg.

commit e899cc8ab64f173297d3c9350319f72f5b517e44
Author:     Romain Beauxis <[email protected]>
AuthorDate: Sun Nov 22 17:42:07 2026 -0500
Commit:     Romain Beauxis <[email protected]>
CommitDate: Wed Nov 25 14:34:52 2026 +0000

    avformat/ogg/muxer: reject identification headers shorter than their layout
    
    Xiph-laced extradata gives the size of the identification header, which
    the splitter does not compare with the size the codec defines. The Theora
    setup then reads its fields past the end of a shorter header.
    
    The check applies the size each codec defines to Vorbis as well, whose
    identification header is always 30 bytes long.
---
 libavformat/ogg/muxer.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/ogg/muxer.c b/libavformat/ogg/muxer.c
index 69b9a679b9..73790d52a1 100644
--- a/libavformat/ogg/muxer.c
+++ b/libavformat/ogg/muxer.c
@@ -607,10 +607,12 @@ static int ogg_init(AVFormatContext *s)
             const char *cstr = st->codecpar->codec_id == AV_CODEC_ID_VORBIS ? 
"vorbis" : "theora";
             int header_type = st->codecpar->codec_id == AV_CODEC_ID_VORBIS ? 3 
: 0x81;
             int framing_bit = st->codecpar->codec_id == AV_CODEC_ID_VORBIS ? 1 
: 0;
+            int first_header_size = st->codecpar->codec_id == 
AV_CODEC_ID_VORBIS ? 30 : 42;
 
             if (avpriv_split_xiph_headers(st->codecpar->extradata, 
st->codecpar->extradata_size,
-                                      st->codecpar->codec_id == 
AV_CODEC_ID_VORBIS ? 30 : 42,
-                                      (const uint8_t**)oggstream->header, 
oggstream->header_len) < 0) {
+                                      first_header_size,
+                                      (const uint8_t**)oggstream->header, 
oggstream->header_len) < 0 ||
+                oggstream->header_len[0] < first_header_size) {
                 av_log(s, AV_LOG_ERROR, "Extradata corrupted\n");
                 oggstream->header[1] = NULL;
                 return AVERROR_INVALIDDATA;

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