Selaa lähdekoodia

LibGfx/ILBM: Explicitly fail decoding if body chunk isn't present

Previously, the decoder would crash in this case.
Tim Ledbetter 1 vuosi sitten
vanhempi
commit
f4a89c31c6
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      Userland/Libraries/LibGfx/ImageFormats/ILBMLoader.cpp

+ 3 - 0
Userland/Libraries/LibGfx/ImageFormats/ILBMLoader.cpp

@@ -289,6 +289,9 @@ static ErrorOr<void> decode_iff_chunks(ILBMLoadingContext& context)
         }
     }
 
+    if (context.state != ILBMLoadingContext::State::BitmapDecoded)
+        return Error::from_string_literal("Missing body chunk");
+
     return {};
 }