From 6fd075f1806e375f66ce436cca15e085f0088118 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Mon, 19 Dec 2011 08:43:10 -0500 Subject: adxdec: Validate channel count to fix a division by zero. --- libavcodec/adx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavcodec/adx.c') diff --git a/libavcodec/adx.c b/libavcodec/adx.c index aa90fd89c3..1e5d89c991 100644 --- a/libavcodec/adx.c +++ b/libavcodec/adx.c @@ -58,7 +58,7 @@ int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf, /* channels */ avctx->channels = buf[7]; - if (avctx->channels > 2) + if (avctx->channels <= 0 || avctx->channels > 2) return AVERROR_INVALIDDATA; /* sample rate */ -- cgit v1.2.3