mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +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
Notes:
sideshowbarker
2024-07-18 23:56:26 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/04c6245fe83
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…
Reference in a new issue