anm: prevent infinite loop

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit 2475f1a83c)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
Laurent Aimar
2011-09-30 23:42:32 +00:00
committed by Reinhard Tartler
parent 7fa13e12e6
commit 39fed2e95b

View File

@@ -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)