Commit 39993860 authored by Laurent Aimar's avatar Laurent Aimar Committed by Michael Niedermayer

Prevent infinite loop in the ANM decoder.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent d39d7122
...@@ -79,6 +79,8 @@ static inline int op(uint8_t **dst, const uint8_t *dst_end, ...@@ -79,6 +79,8 @@ static inline int op(uint8_t **dst, const uint8_t *dst_end,
int striplen = FFMIN(count, remaining); int striplen = FFMIN(count, remaining);
if (buf) { if (buf) {
striplen = FFMIN(striplen, buf_end - *buf); striplen = FFMIN(striplen, buf_end - *buf);
if (*buf >= buf_end)
goto exhausted;
memcpy(*dst, *buf, striplen); memcpy(*dst, *buf, striplen);
*buf += striplen; *buf += striplen;
} else if (pixel >= 0) } else if (pixel >= 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment