From 294ac5d1681f8cbd6575eab1dc52e9170ae2d296 Mon Sep 17 00:00:00 2001
From: Daniel Kang <daniel.d.kang@gmail.com>
Date: Sun, 9 Jan 2011 15:26:29 -0500
Subject: [PATCH] Add check for fli files

---
 libavcodec/flicvideo.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c
index b63d7d4..2314092 100644
--- a/libavcodec/flicvideo.c
+++ b/libavcodec/flicvideo.c
@@ -407,6 +407,10 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,

         frame_size -= chunk_size;
         num_chunks--;
+        if (stream_ptr > buf_size) {
+            av_log(NULL, AV_LOG_ERROR, "Error decoding frame. Invalid header?\n");
+            return AVERROR(EINVAL);
+        }
     }

     /* by the end of the chunk, the stream ptr should equal the frame
--
1.7.2.2

