[FFmpeg-cvslog] imc: validate channel count

Justin Ruggles git at videolan.org
Thu Nov 3 02:23:12 CET 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Fri Oct 28 18:31:21 2011 -0400| [7b7f47e73356d113cace74b922eee0b6ff5ffe0b] | committer: Justin Ruggles

imc: validate channel count

ask for a sample if not mono

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

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

diff --git a/libavcodec/imc.c b/libavcodec/imc.c
index 6bc68cd..d0a0d9d 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -108,6 +108,11 @@ static av_cold int imc_decode_init(AVCodecContext * avctx)
     IMCContext *q = avctx->priv_data;
     double r1, r2;
 
+    if (avctx->channels != 1) {
+        av_log_ask_for_sample(avctx, "Number of channels is not supported\n");
+        return AVERROR_PATCHWELCOME;
+    }
+
     q->decoder_reset = 1;
 
     for(i = 0; i < BANDS; i++)



More information about the ffmpeg-cvslog mailing list