LibGfx: Fix partial loading of tall and interlaced PNG files
The function stopped copying data from a subimage when the _y_ value exceeded the image _width_ value, resulting in an incomplete image.
This commit is contained in:
parent
b8c847a3cd
commit
970a3ef4d8
Notes:
sideshowbarker
2024-07-17 08:37:36 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/970a3ef4d8 Pull-request: https://github.com/SerenityOS/serenity/pull/19282 Reviewed-by: https://github.com/AtkinsSJ ✅ Reviewed-by: https://github.com/gmta ✅
1 changed files with 1 additions and 1 deletions
|
@ -850,7 +850,7 @@ static ErrorOr<void> decode_adam7_pass(PNGLoadingContext& context, Streamer& str
|
|||
|
||||
// Copy the subimage data into the main image according to the pass pattern
|
||||
for (int y = 0, dy = adam7_starty[pass]; y < subimage_context.height && dy < context.height; ++y, dy += adam7_stepy[pass]) {
|
||||
for (int x = 0, dx = adam7_startx[pass]; x < subimage_context.width && dy < context.width; ++x, dx += adam7_stepx[pass]) {
|
||||
for (int x = 0, dx = adam7_startx[pass]; x < subimage_context.width && dx < context.width; ++x, dx += adam7_stepx[pass]) {
|
||||
context.bitmap->set_pixel(dx, dy, subimage_context.bitmap->get_pixel(x, y));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue