Commit f40ec704 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/wavdec: Check for data_size overflow

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 13d605e0
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment