mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 11:36:10 +00:00
LibGfx: Add missing stream error handling in GIF frame descriptor parse
If we try to read a sentinel byte but the stream is fresh out of data, we have to take care of the stream error and bail out right away, or we'll hit an assertion when exiting the function soon after. Fixes #3486.
This commit is contained in:
parent
c0aa455f76
commit
f234b8c129
Notes:
sideshowbarker
2024-07-19 01:24:32 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f234b8c129c
1 changed files with 3 additions and 0 deletions
|
@ -446,6 +446,9 @@ static bool load_gif_frame_descriptors(GIFLoadingContext& context)
|
|||
u8 sentinel = 0;
|
||||
stream >> sentinel;
|
||||
|
||||
if (stream.handle_any_error())
|
||||
return false;
|
||||
|
||||
if (sentinel == 0x21) {
|
||||
u8 extension_type = 0;
|
||||
stream >> extension_type;
|
||||
|
|
Loading…
Add table
Reference in a new issue