summaryrefslogtreecommitdiff
path: root/libavcodec/wmadec.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-03-06 09:58:00 +0100
committerAnton Khirnov <anton@khirnov.net>2013-03-08 08:12:03 +0100
commitea1136baafb1fe271cb56c3f4d7bff0267e3c70f (patch)
treed5a50db8cdf37776f16e76080625dc4fe2dd3c7f /libavcodec/wmadec.c
parent3ba40ebb6cc58753dc3746c718203bb31760deba (diff)
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
Diffstat (limited to 'libavcodec/wmadec.c')
-rw-r--r--libavcodec/wmadec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index 14a1521b1f..dbefbe0886 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 */