OSDN Git Service

adxdec: Validate channel count to fix a division by zero.
authorJustin Ruggles <justin.ruggles@gmail.com>
Mon, 19 Dec 2011 13:43:10 +0000 (08:43 -0500)
committerJustin Ruggles <justin.ruggles@gmail.com>
Tue, 3 Jan 2012 21:28:17 +0000 (16:28 -0500)
libavcodec/adx.c

index aa90fd8..1e5d89c 100644 (file)
@@ -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 */