diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-29 13:34:50 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-29 13:47:44 +0200 |
commit | f40ec70478648c1e6cde43b8577c3c29380372ee (patch) | |
tree | aa2070fdfbe4bfd8c9d9d7c70a95b1e0676ded20 /libavformat/wavdec.c | |
parent | 13d605e090bd408a1040624f7173bcc142f81410 (diff) | |
download | ffmpeg-f40ec70478648c1e6cde43b8577c3c29380372ee.tar.gz |
avformat/wavdec: Check for data_size overflow
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/wavdec.c')
-rw-r--r-- | libavformat/wavdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index db42f59826..1803b5cdaf 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -429,6 +429,11 @@ break_loop: avio_seek(pb, data_ofs, SEEK_SET); + if (data_size > (INT64_MAX>>3)) { + av_log(s, AV_LOG_WARNING, "Data size %"PRId64" is too large\n", data_size); + data_size = 0; + } + if ( data_size > 0 && sample_count && st->codec->channels && (data_size << 3) / sample_count / st->codec->channels > st->codec->bits_per_coded_sample) { av_log(s, AV_LOG_WARNING, "ignoring wrong sample_count %"PRId64"\n", sample_count); |