[FFmpeg-cvslog] bink: Check for out of bound writes when building tree

Laurent Aimar git at videolan.org
Sun Oct 9 04:09:34 CEST 2011


ffmpeg | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Sep 27 12:16:41 2011 +0000| [24adf7832b8370f3c1febbef6c686f574d360d32] | committer: Janne Grunau

bink: Check for out of bound writes when building tree

Signed-off-by: Janne Grunau <janne-libav at jannau.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=24adf7832b8370f3c1febbef6c686f574d360d32
---

 libavcodec/bink.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index e4fdf4c..8a8a912 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 {



More information about the ffmpeg-cvslog mailing list