aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-03-06 09:58:00 +0100
committerReinhard Tartler <siretart@tauware.de>2013-05-09 11:20:11 +0200
commitf13f6f82c63f5b8fc3235c750a69c6ba8ac4cae1 (patch)
tree714a292d8157b7ba915de761c680726372e0faf3 /libavcodec
parent5025dbc577c9a9e0109cb363ac630a9eeda6dc1d (diff)
downloadffmpeg-f13f6f82c63f5b8fc3235c750a69c6ba8ac4cae1.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> (cherry picked from commit c1f479e8df24284237c80ad959619fc85e29a26d) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/wmadec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index f0b043feef..a6f1714f72 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -85,6 +85,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 */