Commit 2475f1a8 authored by Laurent Aimar's avatar Laurent Aimar Committed by Janne Grunau

anm: prevent infinite loop

Signed-off-by: 's avatarJanne Grunau <janne-libav@jannau.net>
parent 6de33611
...@@ -81,6 +81,8 @@ static inline int op(uint8_t **dst, const uint8_t *dst_end, ...@@ -81,6 +81,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