mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-15 19:27:28 +00:00
avcodec/sgidec: fix count check
Fixes: asan_heap-oob_22b30d4_39_038.sgi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a050cf0c45
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
ca47574e16
commit
73c6520c09
@ -98,7 +98,7 @@ static int expand_rle_row16(SgiState *s, uint16_t *out_buf,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
/* Check for buffer overflow. */
|
/* Check for buffer overflow. */
|
||||||
if (pixelstride * (count - 1) >= len) {
|
if (out_end - out_buf <= pixelstride * (count - 1)) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "Invalid pixel count.\n");
|
av_log(s->avctx, AV_LOG_ERROR, "Invalid pixel count.\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user