[libav-stable] wmalosslessdec: Fix reading too many bits in decode_channel_residues()

Anton Khirnov git at libav.org
Sat Sep 29 19:21:33 CEST 2012


Module: libav
Branch: master
Commit: 6a99310fce49f51773ab7d8ffa4f4748bbf58db9

Author:    Anton Khirnov <anton at khirnov.net>
Committer: Anton Khirnov <anton at khirnov.net>
Date:      Sat Sep 29 19:16:32 2012 +0200

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

---

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

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 libav-stable mailing list