[FFmpeg-cvslog] anm: prevent infinite loop

Laurent Aimar git at videolan.org
Mon Mar 19 05:30:35 CET 2012


ffmpeg | branch: release/0.8 | Laurent Aimar <fenrir at videolan.org> | Fri Sep 30 23:42:32 2011 +0000| [39fed2e95b74dcfe8f4a87835bb2c00ab07d030d] | committer: Reinhard Tartler

anm: prevent infinite loop

Signed-off-by: Janne Grunau <janne-libav at jannau.net>
(cherry picked from commit 2475f1a83ccf313d828b25f1769e3a37442ecf64)

Signed-off-by: Anton Khirnov <anton at khirnov.net>

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

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

diff --git a/libavcodec/anm.c b/libavcodec/anm.c
index ef037f2..e2ddacc 100644
--- a/libavcodec/anm.c
+++ b/libavcodec/anm.c
@@ -81,6 +81,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