Browse Source

imc: validate channel count

ask for a sample if not mono
(cherry picked from commit 7b7f47e73356d113cace74b922eee0b6ff5ffe0b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Justin Ruggles 13 years ago
parent
commit
cba03dc667
1 changed files with 5 additions and 0 deletions
  1. 5 0
      libavcodec/imc.c

+ 5 - 0
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++)