diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-07-13 20:08:03 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-08-03 17:44:23 +0200 |
commit | 8e41675e18682ee14a64acf6139d72d22ce669b6 (patch) | |
tree | 61e472a52dd8a7d07d9fe945c4c1e5bc3d5fc283 /libavformat/vividas.c | |
parent | 1cf2f040e34bbfedde60ff3d91b2f7b770aca85b (diff) | |
download | ffmpeg-8e41675e18682ee14a64acf6139d72d22ce669b6.tar.gz |
avformat/vividas: Check if extradata was read successfully
Fixes: OOM
Fixes: 15575/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5654666781655040
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/vividas.c')
-rw-r--r-- | libavformat/vividas.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/vividas.c b/libavformat/vividas.c index 830e318645..c0d39f0a6f 100644 --- a/libavformat/vividas.c +++ b/libavformat/vividas.c @@ -386,7 +386,12 @@ static void track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t offset += av_xiphlacing(&p[offset], data_len[j]); for (j = 0; j < num_data; j++) { - avio_read(pb, &p[offset], data_len[j]); + int ret = avio_read(pb, &p[offset], data_len[j]); + if (ret < data_len[j]) { + st->codecpar->extradata_size = 0; + av_freep(&st->codecpar->extradata); + break; + } offset += data_len[j]; } |