aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-27 12:16:41 +0000
committerJanne Grunau <janne-libav@jannau.net>2011-10-08 16:25:56 +0200
commit24adf7832b8370f3c1febbef6c686f574d360d32 (patch)
treee10a4793244c019f365ee10582f1682d5144f8fe /libavcodec
parentac6eab1496aad6f8b09deabbef4fe5fd829e142d (diff)
downloadffmpeg-24adf7832b8370f3c1febbef6c686f574d360d32.tar.gz
bink: Check for out of bound writes when building tree
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/bink.c2
1 files changed, 1 insertions, 1 deletions
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 {