[FFmpeg-cvslog] dpcm: check to make sure channels is 1 or 2.

Justin Ruggles git at videolan.org
Sat Oct 1 03:06:43 CEST 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Sun Sep 11 12:40:40 2011 -0400| [8d77d12a2be10e8564599ccbfcdd804ff432d885] | committer: Justin Ruggles

dpcm: check to make sure channels is 1 or 2.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8d77d12a2be10e8564599ccbfcdd804ff432d885
---

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

diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c
index cb128af..fc38abd 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;
 



More information about the ffmpeg-cvslog mailing list