summaryrefslogtreecommitdiff
path: root/libavcodec/atrac1.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-24 16:17:29 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-24 16:38:22 +0100
commited017ab945ed2ce13352a0eb627a21e875082834 (patch)
tree18930d413486ead63e84c29446c79965b4b91153 /libavcodec/atrac1.c
parent5c392bac9a11b3a2db9c0ec082695cbb2bfad430 (diff)
atrac1: Check block align.
Fixes OOM Fixes second samples posted in Ticket1893 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/atrac1.c')
-rw-r--r--libavcodec/atrac1.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c
index 26f5cb1739..1ba5593f02 100644
--- a/libavcodec/atrac1.c
+++ b/libavcodec/atrac1.c
@@ -343,6 +343,11 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx)
return AVERROR(EINVAL);
}
+ if (avctx->block_align <= 0) {
+ av_log_ask_for_sample(avctx, "unsupported block align\n");
+ return AVERROR_PATCHWELCOME;
+ }
+
/* Init the mdct transforms */
if ((ret = ff_mdct_init(&q->mdct_ctx[0], 6, 1, -1.0/ (1 << 15))) ||
(ret = ff_mdct_init(&q->mdct_ctx[1], 8, 1, -1.0/ (1 << 15))) ||