[FFmpeg-cvslog] avcodec/wmalosslessdec: check block_align

Michael Niedermayer git at videolan.org
Wed Oct 2 01:24:38 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Oct  2 01:16:11 2013 +0200| [286beebdc34d11a301dfa5189e84f1c399d56133] | committer: Michael Niedermayer

avcodec/wmalosslessdec: check block_align

Code copied from wmaprodec

Fixes null pointer dereference
Fixes Ticket3002

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

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

 libavcodec/wmalosslessdec.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index df44855..ab764ed 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -178,6 +178,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
     unsigned int channel_mask;
     int i, log2_max_num_subframes;
 
+    if (!avctx->block_align) {
+        av_log(avctx, AV_LOG_ERROR, "block_align is not set\n");
+        return AVERROR(EINVAL);
+    }
+
     s->avctx = avctx;
     init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
 



More information about the ffmpeg-cvslog mailing list