From 680097cb6d6b5905fe74c274ee27cb8eebb1513f Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 13 Apr 2012 07:40:53 -0700 Subject: WMAL: Do not try to read rawpcm coefficients if bits is invalid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavcodec/wmalosslessdec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c index 4eb9ebecea..feea6efa11 100644 --- a/libavcodec/wmalosslessdec.c +++ b/libavcodec/wmalosslessdec.c @@ -936,6 +936,11 @@ static int decode_subframe(WmallDecodeCtx *s) if (rawpcm_tile) { int bits = s->bits_per_sample - padding_zeroes; + if (bits <= 0) { + av_log(s->avctx, AV_LOG_ERROR, + "Invalid number of padding bits in raw PCM tile\n"); + return AVERROR_INVALIDDATA; + } av_dlog(s->avctx, "RAWPCM %d bits per sample. " "total %d bits, remain=%d\n", bits, bits * s->num_channels * subframe_len, get_bits_count(&s->gb)); -- cgit v1.2.3