diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-14 14:52:18 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-14 14:52:18 +0200 |
commit | 47c84c0bf784991d95f68d989f4faf31eeb03afa (patch) | |
tree | 61e30d20d2418eff5e730ba66b7bea49ef971564 /libavformat | |
parent | 2a9b4c0f05c2c1b3938e57c477268f1ed68aa096 (diff) | |
download | ffmpeg-47c84c0bf784991d95f68d989f4faf31eeb03afa.tar.gz |
avformat/wavdec: add basic sanity check for the sample count
Fixes Ticket3708
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-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 a865b760b7..1d77402418 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -402,6 +402,11 @@ break_loop: avio_seek(pb, data_ofs, SEEK_SET); + if (data_size > 0 && sample_count && data_size / sample_count / st->codec->channels > 8) { + av_log(s, AV_LOG_WARNING, "ignoring wrong sample_count %"PRId64"\n", sample_count); + sample_count = 0; + } + if (!sample_count || av_get_exact_bits_per_sample(st->codec->codec_id) > 0) if ( st->codec->channels && data_size |