[FFmpeg-cvslog] wmadec: require block_align to be set.

Anton Khirnov git at videolan.org
Sun Sep 22 17:26:22 CEST 2013


ffmpeg | branch: release/0.8 | Anton Khirnov <anton at khirnov.net> | Wed Mar  6 09:58:00 2013 +0100| [f13f6f82c63f5b8fc3235c750a69c6ba8ac4cae1] | committer: Reinhard Tartler

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 at libav.org
(cherry picked from commit ea1136baafb1fe271cb56c3f4d7bff0267e3c70f)

Signed-off-by: Reinhard Tartler <siretart at tauware.de>
(cherry picked from commit c1f479e8df24284237c80ad959619fc85e29a26d)

Signed-off-by: Reinhard Tartler <siretart at tauware.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f13f6f82c63f5b8fc3235c750a69c6ba8ac4cae1
---

 libavcodec/wmadec.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index f0b043f..a6f1714 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 */



More information about the ffmpeg-cvslog mailing list