aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-11-10 22:36:25 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-02-02 14:18:21 +0100
commita3763e63a6a8b29547e75a56bd48a5c60cc9b9fa (patch)
treea0636bd8570435e372360b597cbec8acdafd6959 /libavformat
parentbe6695995d263e1462e41828d3446e6e47ce2511 (diff)
downloadffmpeg-a3763e63a6a8b29547e75a56bd48a5c60cc9b9fa.tar.gz
avformat/vividas: Check sample_rate
Fixes: Assertion c > 0 failed at libavutil/mathematics.c Fixes: 27001/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5726041328582656 Fixes: 27453/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5716060384526336 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 b1bced5433adcf5ad743d929c788b66af9efaf24) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/vividas.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/vividas.c b/libavformat/vividas.c
index 2eedc4edba..fb872767e8 100644
--- a/libavformat/vividas.c
+++ b/libavformat/vividas.c
@@ -373,6 +373,8 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *
avio_rl16(pb); //codec_subid
st->codecpar->channels = avio_rl16(pb); // channels
st->codecpar->sample_rate = avio_rl32(pb); // sample_rate
+ if (st->codecpar->sample_rate <= 0)
+ return AVERROR_INVALIDDATA;
avio_seek(pb, 10, SEEK_CUR); // data_1
q = avio_r8(pb);
avio_seek(pb, q, SEEK_CUR); // data_2