diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-02 01:16:11 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-02 01:24:19 +0200 |
commit | 286beebdc34d11a301dfa5189e84f1c399d56133 (patch) | |
tree | ce450230e42dd83a108cdb65becde6a41f3570a9 /libavcodec/wmalosslessdec.c | |
parent | ad8fbddb94c2d7e0fbcd46d508e962bbfd939ba4 (diff) | |
download | ffmpeg-286beebdc34d11a301dfa5189e84f1c399d56133.tar.gz |
avcodec/wmalosslessdec: check block_align
Code copied from wmaprodec
Fixes null pointer dereference
Fixes Ticket3002
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wmalosslessdec.c')
-rw-r--r-- | libavcodec/wmalosslessdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c index df44855e53..ab764ed8d8 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); |