Kaynağa Gözat

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.
Nico Weber 4 yıl önce
ebeveyn
işleme
1f22a59f9d
1 değiştirilmiş dosya ile 2 ekleme ve 0 silme
  1. 2 0
      Libraries/LibGfx/GIFLoader.cpp

+ 2 - 0
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;