mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 00:08:11 +00:00
LibGfx: Fail PNG decoding on invalid scanline filter
Only filter types 0 thru 4 are valid.
This commit is contained in:
parent
d59a308c7e
commit
fea77abcf6
1 changed files with 6 additions and 0 deletions
|
@ -600,6 +600,12 @@ static bool decode_png_bitmap(PNGLoadingContext& context)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (filter > 4) {
|
||||
dbg() << "Invalid PNG filter: " << filter;
|
||||
context.state = PNGLoadingContext::State::Error;
|
||||
return false;
|
||||
}
|
||||
|
||||
context.scanlines.append({ filter });
|
||||
auto& scanline_buffer = context.scanlines.last().data;
|
||||
auto row_size = ((context.width * context.channels * context.bit_depth) + 7) / 8;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue