[FFmpeg-cvslog] wmapro: prevent division by zero when sample rate is unspecified
Sean McGovern
git at videolan.org
Thu Jan 17 03:09:29 CET 2013
ffmpeg | branch: release/0.8 | Sean McGovern <gseanmcg at gmail.com> | Thu Aug 2 15:37:28 2012 -0400| [dd14723602f278966bdc1b5a39c34fcc8b9afa0e] | committer: Reinhard Tartler
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=dd14723602f278966bdc1b5a39c34fcc8b9afa0e
---
libavcodec/wmaprodec.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 0ae7307..91972c9 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) {
More information about the ffmpeg-cvslog
mailing list