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-03-16 08:21:01 +0100
commitb57ab9d7a9259e99fc70f0c93f17c6a667686da0 (patch)
treeb1e7e6c68d34241a6bcd740ced750d27121e9747 /libavcodec
parent6dbe9313445c79be3ee9a96a7ab5ffb76fa2f66b (diff)
downloadffmpeg-b57ab9d7a9259e99fc70f0c93f17c6a667686da0.tar.gz
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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/wmaprodec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 54b0f57983..1b7797c9f2 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -280,6 +280,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);
ff_fmt_convert_init(&s->fmt_conv, avctx);