---
 libavcodec/dpcm.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c
index c1cd501..539d4c0 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;
 
-- 
1.7.1

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to