avcodec/gsmdec: reject unsupported msn audio modes
authorPiotr Bandurski <ami_stuff@o2.pl>
Tue, 13 Aug 2013 21:09:24 +0000 (23:09 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 13 Aug 2013 21:59:39 +0000 (23:59 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/gsmdec.c

index dc64267..5de6da4 100644 (file)
 
 static av_cold int gsm_init(AVCodecContext *avctx)
 {
+    if (avctx->codec_tag == 0x0032 &&
+        avctx->bit_rate != 13000 &&
+        avctx->bit_rate != 17912 &&
+        avctx->bit_rate != 35824 &&
+        avctx->bit_rate != 71656) {
+        av_log(avctx, AV_LOG_ERROR, "Unsupported audio mode\n");
+        return AVERROR_PATCHWELCOME;
+    }
     avctx->channels       = 1;
     avctx->channel_layout = AV_CH_LAYOUT_MONO;
     if (!avctx->sample_rate)