Commit 6fd075f1 authored by Justin Ruggles's avatar Justin Ruggles

adxdec: Validate channel count to fix a division by zero.

parent 4f1a7877
...@@ -58,7 +58,7 @@ int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf, ...@@ -58,7 +58,7 @@ int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
/* channels */ /* channels */
avctx->channels = buf[7]; avctx->channels = buf[7];
if (avctx->channels > 2) if (avctx->channels <= 0 || avctx->channels > 2)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
/* sample rate */ /* sample rate */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment