g726: Do not try to decode more than one channel.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Sat, 13 Jul 2013 12:17:28 +0000 (14:17 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Sat, 13 Jul 2013 15:16:30 +0000 (17:16 +0200)
Ask for a sample instead.

Reviewed-by: Derek Buitenhuis
libavcodec/g726.c

index 7884f36..d035b3e 100644 (file)
@@ -401,6 +401,10 @@ static av_cold int g726_decode_init(AVCodecContext *avctx)
 {
     G726Context* c = avctx->priv_data;
 
+    if(avctx->channels > 1){
+        avpriv_request_sample(avctx, "Decoding more than one channel");
+        return AVERROR_PATCHWELCOME;
+    }
     avctx->channels       = 1;
     avctx->channel_layout = AV_CH_LAYOUT_MONO;