[FFmpeg-cvslog] brstm: reject negative sample rate

Andreas Cadhalpun git at videolan.org
Tue Nov 10 22:07:35 CET 2015


ffmpeg | branch: master | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Tue Nov 10 20:10:23 2015 +0100| [7b67fe20f6c5ce21ed1cac01fdb1906e515bc87e] | committer: Andreas Cadhalpun

brstm: reject negative sample rate

A negative sample rate causes assertion failures in av_rescale_rnd.

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7b67fe20f6c5ce21ed1cac01fdb1906e515bc87e
---

 libavformat/brstm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/brstm.c b/libavformat/brstm.c
index 4ac9881..bbdbcef 100644
--- a/libavformat/brstm.c
+++ b/libavformat/brstm.c
@@ -205,7 +205,7 @@ static int read_header(AVFormatContext *s)
     avio_skip(s->pb, 1); // padding
 
     st->codec->sample_rate = bfstm ? read32(s) : read16(s);
-    if (!st->codec->sample_rate)
+    if (st->codec->sample_rate <= 0)
         return AVERROR_INVALIDDATA;
 
     if (!bfstm)



More information about the ffmpeg-cvslog mailing list