[FFmpeg-cvslog] wmalosslessdec: Fix reading too many bits in decode_channel_residues()

Anton Khirnov git at videolan.org
Sun Sep 30 13:59:39 CEST 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Sep 29 19:16:32 2012 +0200| [6a99310fce49f51773ab7d8ffa4f4748bbf58db9] | committer: Anton Khirnov

wmalosslessdec: Fix reading too many bits in decode_channel_residues()

Fixes a part of CVE-2012-2795

CC:libav-stable at libav.org

Based on a patch by Michael Niedermayer <michaelni at gmx.at>

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

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

 libavcodec/wmalosslessdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c
index dc83b06..b97f397 100644
--- a/libavcodec/wmalosslessdec.c
+++ b/libavcodec/wmalosslessdec.c
@@ -520,7 +520,7 @@ static int decode_channel_residues(WmallDecodeCtx *s, int ch, int tile_size)
             residue = quo;
         else {
             rem_bits = av_ceil_log2(ave_mean);
-            rem      = rem_bits ? get_bits(&s->gb, rem_bits) : 0;
+            rem      = rem_bits ? get_bits_long(&s->gb, rem_bits) : 0;
             residue  = (quo << rem_bits) + rem;
         }
 



More information about the ffmpeg-cvslog mailing list