summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2021-05-30 12:37:17 +0200
committerLinus Groh <mail@linusgroh.de>2021-05-30 14:42:34 +0100
commita49c77b76d0203a0165f3749c290ef363fbddd44 (patch)
treeb12fdcb5439666b20894d8e7ff5f9b1149676850 /Userland
parent774107f37c63c384f6df91d95e41445023b74900 (diff)
downloadserenity-a49c77b76d0203a0165f3749c290ef363fbddd44.zip
LibGfx: Load correct durations for gifs
The wrong shift effectively set the upper byte to 0, meaning that durations longer than 255 centiseconds (2.55 seconds) were wrapped around. See serenity-fuzz-corpora for an example.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibGfx/GIFLoader.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGfx/GIFLoader.cpp b/Userland/Libraries/LibGfx/GIFLoader.cpp
index 41a33b736f..a4d9a9d497 100644
--- a/Userland/Libraries/LibGfx/GIFLoader.cpp
+++ b/Userland/Libraries/LibGfx/GIFLoader.cpp
@@ -511,7 +511,7 @@ static bool load_gif_frame_descriptors(GIFLoadingContext& context)
u8 transparent = sub_block[0] & 1;
current_image->transparent = transparent == 1;
- u16 duration = sub_block[1] + ((u16)sub_block[2] >> 8);
+ u16 duration = sub_block[1] + ((u16)sub_block[2] << 8);
current_image->duration = duration;
current_image->transparency_index = sub_block[3];