aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-10-01 00:44:58 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-01 20:59:49 +0200
commit1f2a93cf4b8f779da88a36e5c636db3dd481185e (patch)
tree50ca30e880315219166758775de0a808ebe9953e
parent67b704982fe809e0dec571dc93dcb7520d339cf7 (diff)
downloadffmpeg-1f2a93cf4b8f779da88a36e5c636db3dd481185e.tar.gz
Prevent infinite loop in the ANM decoder.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 39993860e1525ca5d1b07521865b7e9e1b294ed7)
-rw-r--r--libavcodec/anm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/anm.c b/libavcodec/anm.c
index 02244f70e1..8e40059576 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)