avformat/wavdec: Check for data_size overflow

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/161/head
Michael Niedermayer 9 years ago
parent 13d605e090
commit f40ec70478
  1. 5
      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);

Loading…
Cancel
Save