LibGfx: Fix global-buffer-overflow in interlaced GIF decode

Regressed with 57e10eadac and immediately
caught by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30507
This commit is contained in:
Andreas Kling 2021-02-07 11:18:55 +01:00
parent 0c66e53544
commit 10420dee7e
Notes: sideshowbarker 2024-07-18 22:33:17 +09:00

View file

@ -404,7 +404,8 @@ static bool decode_frame(GIFLoadingContext& context, size_t frame_index)
if (interlace_pass < 4)
row = INTERLACE_ROW_OFFSETS[interlace_pass];
} else {
row += INTERLACE_ROW_STRIDES[interlace_pass];
if (interlace_pass < 4)
row += INTERLACE_ROW_STRIDES[interlace_pass];
}
} else {
++row;