Commit 86e722ab authored by Paul B Mahol's avatar Paul B Mahol

sgidec: safer check for buffer overflow

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 997e2b59
......@@ -58,7 +58,7 @@ static int expand_rle_row(SgiState *s, uint8_t *out_buf,
}
/* Check for buffer overflow. */
if (out_buf + pixelstride * (count - 1) >= out_end)
if (out_end - out_buf <= pixelstride * (count - 1))
return AVERROR_INVALIDDATA;
if (pixel & 0x80) {
......
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