diff options
author | Laurent Aimar <fenrir@videolan.org> | 2011-09-27 01:02:17 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-10-01 20:39:17 +0200 |
commit | 1860053820a4a3a9cefa5131dbd263645944bc77 (patch) | |
tree | baf19e36d3fe8c00efbddb4fe86b8315f7c507bc | |
parent | 184a156f7aac93cc0e354f526f9842f648c0b433 (diff) | |
download | ffmpeg-1860053820a4a3a9cefa5131dbd263645944bc77.tar.gz |
Check for out of bound writes when building tree in bink decoder.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 254af56dd101bc756194dd080bb99e8f123500dd)
-rw-r--r-- | libavcodec/bink.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/bink.c b/libavcodec/bink.c index b3e53b8a32..f4fa44b761 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 { |