cin audio: validate the channel count
authorJustin Ruggles <justin.ruggles@gmail.com>
Thu, 27 Oct 2011 17:33:57 +0000 (13:33 -0400)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 4 Nov 2011 12:32:18 +0000 (13:32 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/dsicinav.c

index faca821..d4dbb35 100644 (file)
@@ -310,6 +310,11 @@ static av_cold int cinaudio_decode_init(AVCodecContext *avctx)
     CinAudioContext *cin = avctx->priv_data;
 
     cin->avctx = avctx;
+    if (avctx->channels != 1) {
+        av_log_ask_for_sample(avctx, "Number of channels is not supported\n");
+        return AVERROR_PATCHWELCOME;
+    }
+
     cin->initial_decode_frame = 1;
     cin->delta = 0;
     avctx->sample_fmt = AV_SAMPLE_FMT_S16;