1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

sgidec: safer check for buffer overflow

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2013-07-26 21:53:54 +00:00
parent 997e2b59e3
commit 86e722ab97

View File

@ -58,7 +58,7 @@ static int expand_rle_row(SgiState *s, uint8_t *out_buf,
} }
/* Check for buffer overflow. */ /* Check for buffer overflow. */
if (out_buf + pixelstride * (count - 1) >= out_end) if (out_end - out_buf <= pixelstride * (count - 1))
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
if (pixel & 0x80) { if (pixel & 0x80) {