[FFmpeg-cvslog] WMAL: Do not try to read rawpcm coefficients if bits is invalid

Michael Niedermayer git at videolan.org
Sat Apr 14 22:52:16 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Apr 13 07:40:53 2012 -0700| [680097cb6d6b5905fe74c274ee27cb8eebb1513f] | committer: Martin Storsjö

WMAL: Do not try to read rawpcm coefficients if bits is invalid

Signed-off-by: Martin Storsjö <martin at martin.st>

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

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

diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index 4eb9ebe..feea6ef 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));



More information about the ffmpeg-cvslog mailing list