summaryrefslogtreecommitdiff
path: root/libavcodec/anm.c
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 02:41:39 +0200
commit39993860e1525ca5d1b07521865b7e9e1b294ed7 (patch)
tree8f6729a54f8a9de0d1f61433479b8d2d32b5ce6f /libavcodec/anm.c
parentd39d7122e34d2cf994d6dc474fe0c8bee2f7fcfd (diff)
Prevent infinite loop in the ANM decoder.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/anm.c')
-rw-r--r--libavcodec/anm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/anm.c b/libavcodec/anm.c
index b84aef1c1b..188f8296f3 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)