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

avcodec/arbc: Skip tiles in fill_tileX() which are completely outside

Fixes: signed integer overflow: 2052526848 + 147237888 cannot be represented in type 'int'
Fixes: 14441/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARBC_fuzzer-5717632944177152
Fixes: 14453/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARBC_fuzzer-5739679254577152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2019-05-09 23:49:41 +02:00
parent 3d14663f83
commit cdd886a286

View File

@ -94,6 +94,9 @@ static int fill_tileX(AVCodecContext *avctx, int tile_width, int tile_height,
int start_y = y * tile_height, start_x = x * tile_width; int start_y = y * tile_height, start_x = x * tile_width;
int end_y = start_y + tile_height, end_x = start_x + tile_width; int end_y = start_y + tile_height, end_x = start_x + tile_width;
if (start_x >= avctx->width || start_y >= avctx->height)
continue;
for (int j = start_y; j < end_y; j += step_h) { for (int j = start_y; j < end_y; j += step_h) {
for (int k = start_x; k < end_x; k += step_w) { for (int k = start_x; k < end_x; k += step_w) {
if (mask & 0x8000U) { if (mask & 0x8000U) {