mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +00:00
LibGfx: add bounds checking before set_pixel call in GIF decoder
This fixes a crash when a GIF frame extends beyond the limits of the logical screen, causing writes past the end of the frame buffer
This commit is contained in:
parent
a28f29c82c
commit
5567408bab
1 changed files with 1 additions and 1 deletions
|
@ -355,7 +355,7 @@ static bool decode_frame(GIFLoadingContext& context, size_t frame_index)
|
|||
int x = pixel_index % image.width + image.x;
|
||||
int y = row + image.y;
|
||||
|
||||
if (!image.transparent || color != image.transparency_index) {
|
||||
if (context.frame_buffer->rect().contains(x, y) && (!image.transparent || color != image.transparency_index)) {
|
||||
context.frame_buffer->set_pixel(x, y, c);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue