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

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 3ada328..09fd373 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -340,6 +340,11 @@ static int get_nb_samples(AVCodecContext *avctx, const 
uint8_t *buf,
 
     *coded_samples = 0;
 
+    if (ch == 0) {
+        av_log(avctx,AV_LOG_ERROR,"Number of channels = 0\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     switch (avctx->codec->id) {
     /* constant, only check buf_size */
     case CODEC_ID_ADPCM_EA_XAS:
-- 
1.7.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to