[FFmpeg-cvslog] wma: check byte_offset_bits

Michael Niedermayer git at videolan.org
Thu Feb 28 04:30:37 CET 2013


ffmpeg | branch: release/0.5 | Michael Niedermayer <michaelni at gmx.at> | Wed Jan 30 22:56:45 2013 +0100| [c2d3f06882abb0298a76a264b423d7c28155bb70] | committer: Michael Niedermayer

wma: check byte_offset_bits

Fixes assertion failure

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 984add64a41c3296a8a82051cc90bff2eb449609)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/wma.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/wma.c b/libavcodec/wma.c
index ff01f49..12faf27 100644
--- a/libavcodec/wma.c
+++ b/libavcodec/wma.c
@@ -133,6 +133,10 @@ int ff_wma_init(AVCodecContext * avctx, int flags2)
 
     bps = (float)s->bit_rate / (float)(s->nb_channels * s->sample_rate);
     s->byte_offset_bits = av_log2((int)(bps * s->frame_len / 8.0 + 0.5)) + 2;
+    if (s->byte_offset_bits + 3 > MIN_CACHE_BITS) {
+        av_log(avctx, AV_LOG_ERROR, "byte_offset_bits %d is too large\n", s->byte_offset_bits);
+        return AVERROR_PATCHWELCOME;
+    }
 
     /* compute high frequency value and choose if noise coding should
        be activated */



More information about the ffmpeg-cvslog mailing list