From a76a1117f16178cd14d16e1c1451af9377a4e270 Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 12 Apr 2016 17:29:23 -0300 Subject: [PATCH] Fix crash using RotSprite with width/height == 0 (fix #1056) --- src/doc/algorithm/rotsprite.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/doc/algorithm/rotsprite.cpp b/src/doc/algorithm/rotsprite.cpp index 152d0cb1b..06f693d99 100644 --- a/src/doc/algorithm/rotsprite.cpp +++ b/src/doc/algorithm/rotsprite.cpp @@ -179,6 +179,9 @@ void rotsprite_image(Image* bmp, const Image* spr, const Image* mask, int rot_width = xmax - xmin; int rot_height = ymax - ymin; + if (rot_width == 0 || rot_height == 0) + return; + int scale = 8; base::UniquePtr bmp_copy(Image::create(bmp->pixelFormat(), rot_width*scale, rot_height*scale, buf[0])); base::UniquePtr tmp_copy(Image::create(spr->pixelFormat(), spr->width()*scale, spr->height()*scale, buf[1]));