aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean McGovern <gseanmcg@gmail.com>2012-08-02 15:37:28 -0400
committerReinhard Tartler <siretart@tauware.de>2013-01-04 07:43:38 +0100
commitdd14723602f278966bdc1b5a39c34fcc8b9afa0e (patch)
tree04e70b5e98f6ad808d9e6e1a8a8ac0fd1f107cc2
parent9474c93028444f0524e8a09a115fbdc3a3756cd0 (diff)
downloadffmpeg-dd14723602f278966bdc1b5a39c34fcc8b9afa0e.tar.gz
wmapro: prevent division by zero when sample rate is unspecified
This fixes Bugzilla #327: Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com> (cherry picked from commit 3680b2435101a5de56821718a71c828320d535a0) Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavcodec/wmaprodec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 0ae73070d2..91972c9f5c 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -326,6 +326,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) {