avformat/wavdec: Do not discard sample_count due to rounding
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 13 Aug 2015 10:13:51 +0000 (12:13 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 13 Aug 2015 10:38:20 +0000 (12:38 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/wavdec.c

index 8b48fc8..85e7da6 100644 (file)
@@ -435,7 +435,7 @@ break_loop:
     }
 
     if (   data_size > 0 && sample_count && st->codec->channels
-        && (data_size << 3) / sample_count / st->codec->channels > st->codec->bits_per_coded_sample) {
+        && (data_size << 3) / sample_count / st->codec->channels > st->codec->bits_per_coded_sample  + 1) {
         av_log(s, AV_LOG_WARNING, "ignoring wrong sample_count %"PRId64"\n", sample_count);
         sample_count = 0;
     }