1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:27:43 +00:00

LibPDF: Make image creation in Renderer::load_image() fallible

This commit is contained in:
Nico Weber 2024-03-02 14:30:42 -05:00 committed by Tim Flynn
parent 9bff8abcc7
commit c6b484a728

View file

@ -1192,7 +1192,7 @@ PDFErrorOr<Renderer::LoadedImage> Renderer::load_image(NonnullRefPtr<StreamObjec
component_value_decoders.empend(0.0f, 255.0f, dmin, dmax);
}
auto bitmap = MUST(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, { width, height }));
auto bitmap = TRY(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, { width, height }));
int x = 0;
int y = 0;
auto const bytes_per_component = bits_per_component / 8;