[FFmpeg-cvslog] wma: Check channel number before init.

Michael Niedermayer git at videolan.org
Tue Nov 22 02:38:10 CET 2011


ffmpeg | branch: oldabi | Michael Niedermayer <michaelni at gmx.at> | Wed Nov 16 03:31:25 2011 +0100| [fdd09e5d7b2b0fff9458e287c41aea2e89359b23] | committer: Michael Niedermayer

wma: Check channel number before init.
Fixes Ticket240

Based on patch by ami_stuff
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 20431a9982b9bd2c475042d919890a941ad70c71)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index 9eaf230..11895a3 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -109,6 +109,11 @@ static int wma_decode_init(AVCodecContext * avctx)
         }
     }
 
+    if(avctx->channels > MAX_CHANNELS){
+        av_log(avctx, AV_LOG_ERROR, "Invalid number of channels (%d)\n", avctx->channels);
+        return -1;
+    }
+
     if(ff_wma_init(avctx, flags2)<0)
         return -1;
 



More information about the ffmpeg-cvslog mailing list