Skip to content

Commit

Permalink
Check for null images in ImageFromCompressedData (flutter#21891)
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-simmons authored Oct 15, 2020
1 parent ab8b207 commit c2080ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ui/painting/image_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ sk_sp<SkImage> ImageFromCompressedData(fml::RefPtr<ImageDescriptor> descriptor,

if (!descriptor->should_resize(target_width, target_height)) {
// No resizing requested. Just decode & rasterize the image.
return descriptor->image()->makeRasterImage();
sk_sp<SkImage> image = descriptor->image();
return image ? image->makeRasterImage() : nullptr;
}

const SkISize source_dimensions = descriptor->image_info().dimensions();
Expand Down

0 comments on commit c2080ec

Please sign in to comment.