Commit dd0bfc3a authored by Luca Barbato's avatar Luca Barbato

dsicinav: Bound-check the source buffer when needed

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
parent fcae3ff1
......@@ -195,11 +195,13 @@ static void cin_decode_rle(const unsigned char *src, int src_size,
while (src < src_end && dst < dst_end) {
code = *src++;
if (code & 0x80) {
if (src >= src_end)
break;
len = code - 0x7F;
memset(dst, *src++, FFMIN(len, dst_end - dst));
} else {
len = code + 1;
memcpy(dst, src, FFMIN(len, dst_end - dst));
memcpy(dst, src, FFMIN3(len, dst_end - dst, src_end - src));
src += len;
}
dst += len;
......
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