Commit 13d605e0 authored by Ganesh Ajjanagadde's avatar Ganesh Ajjanagadde Committed by Michael Niedermayer

wavdec: make sample count check more precise

May be used to fix Ticket4577
Signed-off-by: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 9ec17e45
...@@ -430,7 +430,7 @@ break_loop: ...@@ -430,7 +430,7 @@ break_loop:
avio_seek(pb, data_ofs, SEEK_SET); avio_seek(pb, data_ofs, SEEK_SET);
if ( data_size > 0 && sample_count && st->codec->channels if ( data_size > 0 && sample_count && st->codec->channels
&& data_size / sample_count / st->codec->channels > 8) { && (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); av_log(s, AV_LOG_WARNING, "ignoring wrong sample_count %"PRId64"\n", sample_count);
sample_count = 0; sample_count = 0;
} }
......
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