From 24adf7832b8370f3c1febbef6c686f574d360d32 Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Tue, 27 Sep 2011 12:16:41 +0000 Subject: [PATCH] bink: Check for out of bound writes when building tree Signed-off-by: Janne Grunau --- libavcodec/bink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/bink.c b/libavcodec/bink.c index e4fdf4c93e..8a8a912867 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -247,7 +247,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 {