From: Laurent Aimar Date: Fri, 30 Sep 2011 23:42:32 +0000 (+0000) Subject: anm: prevent infinite loop X-Git-Tag: v0.8b1~1213 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2475f1a83ccf313d828b25f1769e3a37442ecf64;p=platform%2Fupstream%2Flibav.git anm: prevent infinite loop Signed-off-by: Janne Grunau --- diff --git a/libavcodec/anm.c b/libavcodec/anm.c index 94cac5e..59de984 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)