sw_engine Raster: Add null check for transform

If transform is null, identify matrix is used.
This commit is contained in:
JunsuChoi 2020-11-30 15:20:49 +09:00 committed by Hermet Park
parent 7ec52e6c9e
commit d8d754e969

View file

@ -258,8 +258,8 @@ static bool _rasterImage(SwSurface* surface, uint32_t *img, const SwBBox& region
bool rasterImage(SwSurface* surface, SwImage* image, uint8_t opacity, const Matrix* transform) bool rasterImage(SwSurface* surface, SwImage* image, uint8_t opacity, const Matrix* transform)
{ {
Matrix invTransform; Matrix invTransform = { 1, 0, 0, 0, 1, 0, 0, 0, 1 };
_inverse(transform, &invTransform); if (transform) _inverse(transform, &invTransform);
if (image->rle) { if (image->rle) {
if (opacity < 255) return _rasterTranslucentImageRle(surface, image->rle, image->data, opacity, &invTransform, image->width, image->height ); if (opacity < 255) return _rasterTranslucentImageRle(surface, image->rle, image->data, opacity, &invTransform, image->width, image->height );
return _rasterImageRle(surface, image->rle, image->data, &invTransform, image->width, image->height ); return _rasterImageRle(surface, image->rle, image->data, &invTransform, image->width, image->height );