[FFmpeg-cvslog] Check for out of bound writes when building tree in bink decoder.
Laurent Aimar
git at videolan.org
Sat Oct 1 21:38:52 CEST 2011
ffmpeg | branch: release/0.8 | Laurent Aimar <fenrir at videolan.org> | Tue Sep 27 01:02:17 2011 +0200| [1860053820a4a3a9cefa5131dbd263645944bc77] | committer: Michael Niedermayer
Check for out of bound writes when building tree in bink decoder.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 254af56dd101bc756194dd080bb99e8f123500dd)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1860053820a4a3a9cefa5131dbd263645944bc77
---
libavcodec/bink.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index b3e53b8..f4fa44b 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -246,7 +246,7 @@ static void read_tree(GetBitContext *gb, Tree *tree)
tree->syms[i] = get_bits(gb, 4);
tmp1[tree->syms[i]] = 1;
}
- for (i = 0; i < 16; i++)
+ for (i = 0; i < 16 && len < 16 - 1; i++)
if (!tmp1[i])
tree->syms[++len] = i;
} else {
More information about the ffmpeg-cvslog
mailing list