diff options
Diffstat (limited to 'Userland/Libraries/LibGfx/BMPWriter.cpp')
-rw-r--r-- | Userland/Libraries/LibGfx/BMPWriter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGfx/BMPWriter.cpp b/Userland/Libraries/LibGfx/BMPWriter.cpp index e52f9d07f0..0de6bf3417 100644 --- a/Userland/Libraries/LibGfx/BMPWriter.cpp +++ b/Userland/Libraries/LibGfx/BMPWriter.cpp @@ -46,7 +46,7 @@ static ByteBuffer write_pixel_data(const RefPtr<Bitmap> bitmap, int pixel_row_da { int image_size = pixel_row_data_size * bitmap->height(); auto buffer_result = ByteBuffer::create_uninitialized(image_size); - if (!buffer_result.has_value()) + if (buffer_result.is_error()) return {}; auto buffer = buffer_result.release_value(); @@ -100,7 +100,7 @@ ByteBuffer BMPWriter::dump(const RefPtr<Bitmap> bitmap, DibHeader dib_header) int pixel_row_data_size = (m_bytes_per_pixel * 8 * bitmap->width() + 31) / 32 * 4; int image_size = pixel_row_data_size * bitmap->height(); auto buffer_result = ByteBuffer::create_uninitialized(pixel_data_offset); - if (!buffer_result.has_value()) + if (buffer_result.is_error()) return {}; auto buffer = buffer_result.release_value(); |