diff --git a/Userland/Utilities/image.cpp b/Userland/Utilities/image.cpp index 6f99b916f0..74d3654ba3 100644 --- a/Userland/Utilities/image.cpp +++ b/Userland/Utilities/image.cpp @@ -41,6 +41,10 @@ ErrorOr serenity_main(Main::Arguments arguments) auto file = TRY(Core::MappedFile::map(in_path)); auto decoder = Gfx::ImageDecoder::try_create_for_raw_bytes(file->bytes()); + if (!decoder) { + warnln("Failed to decode input file '{}'", in_path); + return 1; + } // This uses ImageDecoder instead of Bitmap::load_from_file() to have more control // over selecting a frame, access color profile data, and so on in the future.