mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 07:54:58 +00:00
LibImageDecoderClient: Decoded images with 0 frames are not successful
Previously you could pass anything (e.g a text file) to ImageDecoder and it would "succeed" in decoding it and give you back a 0-frame result. Let's consider that state a failure instead.
This commit is contained in:
parent
3168a4afe8
commit
fa0e23009a
1 changed files with 3 additions and 0 deletions
|
@ -51,6 +51,9 @@ Optional<DecodedImage> Client::decode_image(const ByteBuffer& encoded_data)
|
|||
|
||||
auto& response = response_or_error.value();
|
||||
|
||||
if (response.bitmaps().is_empty())
|
||||
return {};
|
||||
|
||||
DecodedImage image;
|
||||
image.is_animated = response.is_animated();
|
||||
image.loop_count = response.loop_count();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue