diff options
author | Laurent Aimar <fenrir@videolan.org> | 2011-09-30 23:42:32 +0000 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2012-03-18 17:50:40 +0100 |
commit | 39fed2e95b74dcfe8f4a87835bb2c00ab07d030d (patch) | |
tree | 6fd93405060a0b1a17db2af8b5877d9bacda9e75 | |
parent | 7fa13e12e6eb0c791578e53a32dd6de0de0f8743 (diff) | |
download | ffmpeg-39fed2e95b74dcfe8f4a87835bb2c00ab07d030d.tar.gz |
anm: prevent infinite loop
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 2475f1a83ccf313d828b25f1769e3a37442ecf64)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r-- | libavcodec/anm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/anm.c b/libavcodec/anm.c index ef037f2468..e2ddacc200 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) |