Module: libav
Branch: release/9
Commit: c1f479e8df24284237c80ad959619fc85e29a26d

Author:    Anton Khirnov <[email protected]>
Committer: Reinhard Tartler <[email protected]>
Date:      Wed Mar  6 09:58:00 2013 +0100

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:[email protected]
(cherry picked from commit ea1136baafb1fe271cb56c3f4d7bff0267e3c70f)

Signed-off-by: Reinhard Tartler <[email protected]>

---

 libavcodec/wmadec.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index e2803bb..2f4afd3 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 */

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to