mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
sw_engine: fix TexmapPolygon rastering
The y range initialization was missing a check to ensure that the height is a positive value. This could lead to an attempt to call malloc with a negative argument, which cast to an unsigned value, caused a crash.
This commit is contained in:
parent
f5337015e9
commit
a08c73b08b
1 changed files with 1 additions and 3 deletions
|
@ -53,12 +53,10 @@ static bool _arrange(const SwImage* image, const SwBBox* region, int& yStart, in
|
|||
regionBottom = image->rle->spans[image->rle->size - 1].y;
|
||||
}
|
||||
|
||||
if (yStart >= regionBottom) return false;
|
||||
|
||||
if (yStart < regionTop) yStart = regionTop;
|
||||
if (yEnd > regionBottom) yEnd = regionBottom;
|
||||
|
||||
return true;
|
||||
return yEnd > yStart;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue