diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-03-06 12:58:00 +0400 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-05-09 22:05:52 +0400 |
commit | 280998b13cb8f8c8f771fbdf9257c6a8694577da (patch) | |
tree | cfd77781352d54fa4740d2944f4a9d415d54ce50 | |
parent | 530d10792de29a25dc56781abe6864e5b31b8ced (diff) |
wmaprodec: require block_align to be set.
Avoids an infinite loop in the calling programs with decoder not
consuming any input and not returning output.
CC:libav-stable@libav.org
(cherry picked from commit cacad1c058f66558ec727faac3b277d2dee264d4)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
(cherry picked from commit 20373a66ec68d958c266f643a7d0e5ec254c0fcc)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r-- | libavcodec/wmaprodec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 2dfdde70b6..3c21d537cf 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -277,6 +277,11 @@ static av_cold int decode_init(AVCodecContext *avctx) int log2_max_num_subframes; int num_possible_block_sizes; + if (!avctx->block_align) { + av_log(avctx, AV_LOG_ERROR, "block_align is not set\n"); + return AVERROR(EINVAL); + } + s->avctx = avctx; dsputil_init(&s->dsp, avctx); init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE); |