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:
Andreas Kling 2020-11-13 11:49:33 +01:00
parent c0aa455f76
commit f234b8c129
Notes: sideshowbarker 2024-07-19 01:24:32 +09:00

View file

@ -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;