avformat/takdec: Check for multiple streaminfo
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 2 Jul 2019 19:11:57 +0000 (21:11 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 17 Jul 2019 21:18:50 +0000 (23:18 +0200)
Fixes: memleak
Fixes: 15446/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5662875831500800

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/takdec.c

index c51a020..5e06018 100644 (file)
@@ -80,6 +80,8 @@ static int tak_read_header(AVFormatContext *s)
 
         switch (type) {
         case TAK_METADATA_STREAMINFO:
+            if (st->codecpar->extradata)
+                return AVERROR_INVALIDDATA;
         case TAK_METADATA_LAST_FRAME:
         case TAK_METADATA_ENCODER:
             if (size <= 3)