From 8d77d12a2be10e8564599ccbfcdd804ff432d885 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sun, 11 Sep 2011 12:40:40 -0400 Subject: dpcm: check to make sure channels is 1 or 2. --- libavcodec/dpcm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavcodec/dpcm.c') diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c index cb128affed..fc38abdb7a 100644 --- a/libavcodec/dpcm.c +++ b/libavcodec/dpcm.c @@ -117,6 +117,11 @@ static av_cold int dpcm_decode_init(AVCodecContext *avctx) int i; short square; + if (avctx->channels < 1 || avctx->channels > 2) { + av_log(avctx, AV_LOG_INFO, "invalid number of channels\n"); + return AVERROR(EINVAL); + } + s->channels = avctx->channels; s->sample[0] = s->sample[1] = 0; -- cgit v1.2.3