mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 02:03:06 -05:00
LibGfx: Don't proceed with GIF format sniffing if stream read fails
This commit is contained in:
parent
838127df35
commit
9c772a64a1
Notes:
sideshowbarker
2024-07-19 07:18:12 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9c772a64a1b
1 changed files with 3 additions and 0 deletions
|
@ -111,6 +111,9 @@ Optional<GIFFormat> decode_gif_header(BufferStream& stream)
|
|||
for (int i = 0; i < 6; ++i)
|
||||
stream >> header[i];
|
||||
|
||||
if (stream.handle_read_failure())
|
||||
return {};
|
||||
|
||||
if (!memcmp(header, valid_header_87, sizeof(header)))
|
||||
return GIFFormat::GIF87a;
|
||||
else if (!memcmp(header, valid_header_89, sizeof(header)))
|
||||
|
|
Loading…
Add table
Reference in a new issue