mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-27 03:16:58 +00:00
Fix crash using RotSprite with width/height == 0 (fix #1056)
This commit is contained in:
parent
7c9ba13321
commit
a76a1117f1
@ -179,6 +179,9 @@ void rotsprite_image(Image* bmp, const Image* spr, const Image* mask,
|
|||||||
int rot_width = xmax - xmin;
|
int rot_width = xmax - xmin;
|
||||||
int rot_height = ymax - ymin;
|
int rot_height = ymax - ymin;
|
||||||
|
|
||||||
|
if (rot_width == 0 || rot_height == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
int scale = 8;
|
int scale = 8;
|
||||||
base::UniquePtr<Image> bmp_copy(Image::create(bmp->pixelFormat(), rot_width*scale, rot_height*scale, buf[0]));
|
base::UniquePtr<Image> bmp_copy(Image::create(bmp->pixelFormat(), rot_width*scale, rot_height*scale, buf[0]));
|
||||||
base::UniquePtr<Image> tmp_copy(Image::create(spr->pixelFormat(), spr->width()*scale, spr->height()*scale, buf[1]));
|
base::UniquePtr<Image> tmp_copy(Image::create(spr->pixelFormat(), spr->width()*scale, spr->height()*scale, buf[1]));
|
||||||
|
Loading…
Reference in New Issue
Block a user