summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Libraries/LibGfx/JPGLoader.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGfx/JPGLoader.cpp b/Userland/Libraries/LibGfx/JPGLoader.cpp
index 07fb88fb47..08a2db96c4 100644
--- a/Userland/Libraries/LibGfx/JPGLoader.cpp
+++ b/Userland/Libraries/LibGfx/JPGLoader.cpp
@@ -420,6 +420,8 @@ static Optional<Vector<Macroblock>> decode_huffman_stream(JPGLoadingContext& con
static inline bool bounds_okay(const size_t cursor, const size_t delta, const size_t bound)
{
+ if (Checked<size_t>::addition_would_overflow(delta, cursor))
+ return false;
return (delta + cursor) < bound;
}