summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2020-11-29 14:04:14 -0500
committerAndreas Kling <kling@serenityos.org>2020-11-29 20:21:30 +0100
commit1f22a59f9d0f442eec37f8dab9ee4f6577c00caf (patch)
tree137ebb7dd0e77c2cfe2f6a848c55f8c846687577 /Libraries
parent86cec77eb59185e1b04a5a5c5fe0b649dab3d923 (diff)
downloadserenity-1f22a59f9d0f442eec37f8dab9ee4f6577c00caf.zip
LibGfx: Don't assert on files ending right before lzw_min_code_size
Not yet found by oss-fuzz, but I hit it a while ago when running FuzzGIFLoader locally.
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGfx/GIFLoader.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibGfx/GIFLoader.cpp b/Libraries/LibGfx/GIFLoader.cpp
index 63feed39c8..0fc1c42ff8 100644
--- a/Libraries/LibGfx/GIFLoader.cpp
+++ b/Libraries/LibGfx/GIFLoader.cpp
@@ -569,6 +569,8 @@ static bool load_gif_frame_descriptors(GIFLoadingContext& context)
}
stream >> image.lzw_min_code_size;
+ if (stream.handle_any_error())
+ return false;
u8 lzw_encoded_bytes_expected = 0;