[FFmpeg-cvslog] truespeech: check to make sure channels == 1

Justin Ruggles git at videolan.org
Fri Oct 14 03:58:30 CEST 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Wed Oct 12 23:23:18 2011 -0400| [3e7a176759e8a8e66d65c779b47b5bba793dfd4e] | committer: Justin Ruggles

truespeech: check to make sure channels == 1

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3e7a176759e8a8e66d65c779b47b5bba793dfd4e
---

 libavcodec/truespeech.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c
index 6f663f3..555ec87 100644
--- a/libavcodec/truespeech.c
+++ b/libavcodec/truespeech.c
@@ -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;
 }



More information about the ffmpeg-cvslog mailing list