aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-27 01:02:17 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-01 20:39:17 +0200
commit1860053820a4a3a9cefa5131dbd263645944bc77 (patch)
treebaf19e36d3fe8c00efbddb4fe86b8315f7c507bc
parent184a156f7aac93cc0e354f526f9842f648c0b433 (diff)
downloadffmpeg-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.c2
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 {