diff options
author | Laurent Aimar <fenrir@videolan.org> | 2011-10-01 00:44:58 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-10-01 02:41:39 +0200 |
commit | 39993860e1525ca5d1b07521865b7e9e1b294ed7 (patch) | |
tree | 8f6729a54f8a9de0d1f61433479b8d2d32b5ce6f /libavcodec | |
parent | d39d7122e34d2cf994d6dc474fe0c8bee2f7fcfd (diff) | |
download | ffmpeg-39993860e1525ca5d1b07521865b7e9e1b294ed7.tar.gz |
Prevent infinite loop in the ANM decoder.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-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 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) |