[FFmpeg-cvslog] avcodec/wmaprodec: Check block_align

Michael Niedermayer git at videolan.org
Tue Jul 9 16:26:56 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jul  9 14:01:13 2013 +0200| [7d9cb126893d56ea7b4e1cf4715a7c5e6dc66ad6] | committer: Michael Niedermayer

avcodec/wmaprodec: Check block_align

Fixes undefined behavior
Its not known if this condition can be triggered through crafted input.

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

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

 libavcodec/wmaprodec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index c4e0b0a..ca57f64 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -306,6 +306,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
 
     /** generic init */
     s->log2_frame_size = av_log2(avctx->block_align) + 4;
+    if (s->log2_frame_size > 25) {
+        avpriv_request_sample(avctx, "Large block align");
+        return AVERROR_PATCHWELCOME;
+    }
 
     /** frame info */
     s->skip_frame  = 1; /* skip first frame */



More information about the ffmpeg-cvslog mailing list