mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 09:47:35 +00:00
LibGfx: Fail PBM decode if there isn't enough color data in image
Found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29417
This commit is contained in:
parent
e1cc2acded
commit
04c6245fe8
1 changed files with 6 additions and 0 deletions
|
@ -101,6 +101,12 @@ static bool read_image_data(PBMLoadingContext& context, Streamer& streamer)
|
|||
}
|
||||
}
|
||||
|
||||
size_t context_size = (u32)context.width * (u32)context.height;
|
||||
if (context_size != color_data.size()) {
|
||||
dbgln("Not enough color data in image.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!create_bitmap(context)) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue