From 2475f1a83ccf313d828b25f1769e3a37442ecf64 Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Fri, 30 Sep 2011 23:42:32 +0000 Subject: anm: prevent infinite loop Signed-off-by: Janne Grunau --- libavcodec/anm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavcodec/anm.c') diff --git a/libavcodec/anm.c b/libavcodec/anm.c index 94cac5e3ce..59de984301 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) -- cgit v1.2.3