[FFmpeg-cvslog] Prevent infinite loop in the ANM decoder.

Laurent Aimar git at videolan.org
Sat Oct 1 21:38:59 CEST 2011


ffmpeg | branch: release/0.8 | Laurent Aimar <fenrir at videolan.org> | Sat Oct  1 00:44:58 2011 +0200| [1f2a93cf4b8f779da88a36e5c636db3dd481185e] | committer: Michael Niedermayer

Prevent infinite loop in the ANM decoder.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 39993860e1525ca5d1b07521865b7e9e1b294ed7)

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

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

diff --git a/libavcodec/anm.c b/libavcodec/anm.c
index 02244f7..8e40059 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)



More information about the ffmpeg-cvslog mailing list