Browse Source

avformat/vividas: Check and require 1 video stream

The decoder hardcodes that audio is stream_id = 1 so it does not
currently work with more or less than 1 video stream at st=0

Fixes: assertion failure
Fixes: 18602/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6259277199310848

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3e5a528bbe)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.2.2
Michael Niedermayer 6 years ago
parent
commit
f21ef41c14
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      libavformat/vividas.c

+ 4
- 2
libavformat/vividas.c View File

@@ -311,8 +311,10 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *
num_video = avio_r8(pb); num_video = avio_r8(pb);


avio_seek(pb, off, SEEK_SET); avio_seek(pb, off, SEEK_SET);
if (num_video != 1)
av_log(s, AV_LOG_WARNING, "number of video tracks %d is not 1\n", num_video);
if (num_video != 1) {
av_log(s, AV_LOG_ERROR, "number of video tracks %d is not 1\n", num_video);
return AVERROR_PATCHWELCOME;
}


for (i = 0; i < num_video; i++) { for (i = 0; i < num_video; i++) {
AVStream *st = avformat_new_stream(s, NULL); AVStream *st = avformat_new_stream(s, NULL);


Loading…
Cancel
Save