truespeech: check to make sure channels == 1
authorJustin Ruggles <justin.ruggles@gmail.com>
Thu, 13 Oct 2011 03:23:18 +0000 (23:23 -0400)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 4 Nov 2011 00:09:22 +0000 (01:09 +0100)
(cherry picked from commit 3e7a176759e8a8e66d65c779b47b5bba793dfd4e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/truespeech.c

index d903a01..b5f7466 100644 (file)
@@ -56,6 +56,11 @@ static av_cold int truespeech_decode_init(AVCodecContext * avctx)
 {
 //    TSContext *c = avctx->priv_data;
 
+    if (avctx->channels != 1) {
+        av_log_ask_for_sample(avctx, "Unsupported channel count: %d\n", avctx->channels);
+        return AVERROR(EINVAL);
+    }
+
     avctx->sample_fmt = AV_SAMPLE_FMT_S16;
     return 0;
 }