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 {