summaryrefslogtreecommitdiff
path: root/libavcodec/anm.c
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-30 23:42:32 +0000
committerJanne Grunau <janne-libav@jannau.net>2011-10-10 21:36:12 +0200
commit2475f1a83ccf313d828b25f1769e3a37442ecf64 (patch)
treead86be39a960cf4336a1a6f4feee1868fb97d996 /libavcodec/anm.c
parent6de33611c918e6ad5bbc878840a59607cb42b8c0 (diff)
anm: prevent infinite loop
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
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 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)