mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibGfx: Fail JPEG decode instead of asserting on bogus start-of-scan
Found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28628
This commit is contained in:
parent
0fc8561029
commit
cd046fae44
Notes:
sideshowbarker
2024-07-19 00:39:21 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/cd046fae44f
1 changed files with 4 additions and 1 deletions
|
@ -552,7 +552,10 @@ static bool read_start_of_scan(InputMemoryStream& stream, JPGLoadingContext& con
|
|||
auto it = context.components.find(component_id);
|
||||
if (it != context.components.end()) {
|
||||
component = &it->value;
|
||||
ASSERT(i == component->serial_id);
|
||||
if (i != component->serial_id) {
|
||||
dbgln("JPEG decode failed (i != component->serial_id)");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
#ifdef JPG_DEBUG
|
||||
dbg() << stream.offset() << String::format(": Unsupported component id: %i!", component_id);
|
||||
|
|
Loading…
Reference in a new issue