You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02: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>
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user