[FFmpeg-cvslog] Check for out of bound writes when building tree in bink decoder.

Laurent Aimar git at videolan.org
Tue Sep 27 15:16:41 CEST 2011


ffmpeg | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Sep 27 01:02:17 2011 +0200| [254af56dd101bc756194dd080bb99e8f123500dd] | committer: Michael Niedermayer

Check for out of bound writes when building tree in bink decoder.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index 3c2148b..ac12a4b 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