summaryrefslogtreecommitdiff
path: root/libavcodec/dpcm.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-09-11 12:40:40 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-09-30 18:15:53 -0400
commit8d77d12a2be10e8564599ccbfcdd804ff432d885 (patch)
tree0c64b8d6a80f9c457bf41417960103fd5e2bc93e /libavcodec/dpcm.c
parent4bad464e7f5731e2f554ea673f54e8d770bc109e (diff)
dpcm: check to make sure channels is 1 or 2.
Diffstat (limited to 'libavcodec/dpcm.c')
-rw-r--r--libavcodec/dpcm.c5
1 files changed, 5 insertions, 0 deletions
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;