diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-03-06 09:58:00 +0100 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-03-09 18:01:09 +0100 |
commit | c1f479e8df24284237c80ad959619fc85e29a26d (patch) | |
tree | a4ad4f64605d0c1aa5129d551fed13241d08c847 | |
parent | 74880e78d83031d612c941a383b810ff0c9d50c6 (diff) | |
download | ffmpeg-c1f479e8df24284237c80ad959619fc85e29a26d.tar.gz |
wmadec: 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 ea1136baafb1fe271cb56c3f4d7bff0267e3c70f)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r-- | libavcodec/wmadec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index e2803bb2a3..2f4afd3aa9 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -72,6 +72,11 @@ static int wma_decode_init(AVCodecContext * avctx) int i, flags2; uint8_t *extradata; + if (!avctx->block_align) { + av_log(avctx, AV_LOG_ERROR, "block_align is not set\n"); + return AVERROR(EINVAL); + } + s->avctx = avctx; /* extract flag infos */ |