[FFmpeg-cvslog] wmapro: prevent division by zero when sample rate is unspecified

Sean McGovern git at videolan.org
Thu Oct 25 17:10:47 CEST 2012


ffmpeg | branch: release/0.10 | Sean McGovern <gseanmcg at gmail.com> | Thu Aug  2 15:37:28 2012 -0400| [a2d4d9f4fbe13cb259f06fb907a056b6f3dd2d15] | committer: Anton Khirnov

wmapro: prevent division by zero when sample rate is unspecified

This fixes Bugzilla #327:

Signed-off-by: Kostya Shishkov <kostya.shishkov at gmail.com>
(cherry picked from commit 3680b2435101a5de56821718a71c828320d535a0)

Signed-off-by: Anton Khirnov <anton at khirnov.net>

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

 libavcodec/wmaprodec.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 3b8c2c8..9804cc2 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -330,6 +330,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
         return AVERROR_INVALIDDATA;
     }
 
+    if (s->avctx->sample_rate <= 0) {
+        av_log(avctx, AV_LOG_ERROR, "invalid sample rate\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     s->num_channels = avctx->channels;
 
     if (s->num_channels < 0) {



More information about the ffmpeg-cvslog mailing list