[FFmpeg-devel] [PATCH 05/12] Prevent infinite loop in the ANM decoder.

fenrir at elivagar.org fenrir at elivagar.org
Sat Oct 1 00:44:58 CEST 2011


From: Laurent Aimar <fenrir at videolan.org>

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

diff --git a/libavcodec/anm.c b/libavcodec/anm.c
index b84aef1..188f829 100644
--- a/libavcodec/anm.c
+++ b/libavcodec/anm.c
@@ -79,6 +79,8 @@ static inline int op(uint8_t **dst, const uint8_t *dst_end,
         int striplen = FFMIN(count, remaining);
         if (buf) {
             striplen = FFMIN(striplen, buf_end - *buf);
+            if (*buf >= buf_end)
+                goto exhausted;
             memcpy(*dst, *buf, striplen);
             *buf += striplen;
         } else if (pixel >= 0)
-- 
1.7.2.5



More information about the ffmpeg-devel mailing list