Browse Source

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

Previously, the decoder would crash in this case.
Tim Ledbetter 1 năm trước cách đây
mục cha
commit
f4a89c31c6

+ 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 {};
     return {};
 }
 }