Commit 83fc6c82 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/wavdec: Dont trust the fact chunk for PCM

Fixes Ticket3033
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 3aa57651
...@@ -403,11 +403,15 @@ break_loop: ...@@ -403,11 +403,15 @@ break_loop:
avio_seek(pb, data_ofs, SEEK_SET); avio_seek(pb, data_ofs, SEEK_SET);
if (!sample_count && st->codec->channels && if (!sample_count || av_get_exact_bits_per_sample(st->codec->codec_id) > 0)
av_get_bits_per_sample(st->codec->codec_id) && wav->data_end <= avio_size(pb)) if ( st->codec->channels
sample_count = (data_size << 3) / && data_size
(st->codec->channels * && av_get_bits_per_sample(st->codec->codec_id)
(uint64_t)av_get_bits_per_sample(st->codec->codec_id)); && wav->data_end <= avio_size(pb))
sample_count = (data_size << 3)
/
(st->codec->channels * (uint64_t)av_get_bits_per_sample(st->codec->codec_id));
if (sample_count) if (sample_count)
st->duration = sample_count; st->duration = 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