summaryrefslogtreecommitdiff
path: root/libavcodec/wmaprodec.c
diff options
context:
space:
mode:
authorSean McGovern <gseanmcg@gmail.com>2012-08-02 15:37:28 -0400
committerKostya Shishkov <kostya.shishkov@gmail.com>2012-08-03 07:07:00 +0200
commit3680b2435101a5de56821718a71c828320d535a0 (patch)
tree3fa9c31682b136c5880f7162d28faaac80bdf3ba /libavcodec/wmaprodec.c
parent03737412a32c3b7e52cfe661bde7947665898c19 (diff)
wmapro: prevent division by zero when sample rate is unspecified
This fixes Bugzilla #327: Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
Diffstat (limited to 'libavcodec/wmaprodec.c')
-rw-r--r--libavcodec/wmaprodec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 30a43c8585..699c1b7503 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -335,6 +335,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) {