fix(thorvg): fix sw_engine crash (#6372)

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
VIFEX 2024-06-14 20:08:36 +08:00 committed by GitHub
parent 269dd90211
commit 25db891e3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -88,7 +88,7 @@ static bool _rasterMaskedPolygonImageSegment(SwSurface* surface, const SwImage*
int32_t sh = image->h;
int32_t x1, x2, x, y, ar, ab, iru, irv, px, ay;
int32_t vv = 0, uu = 0;
int32_t minx = INT32_MAX, maxx = INT32_MIN;
int32_t minx = INT32_MAX, maxx = 0;
float dx, u, v, iptr;
SwSpan* span = nullptr; //used only when rle based.
@ -116,7 +116,7 @@ static bool _rasterMaskedPolygonImageSegment(SwSurface* surface, const SwImage*
if (!region) {
minx = INT32_MAX;
maxx = INT32_MIN;
maxx = 0;
//one single row, could be consisted of multiple spans.
while (span->y == y && spanIdx < image->rle->size) {
if (minx > span->x) minx = span->x;
@ -281,7 +281,7 @@ static void _rasterBlendingPolygonImageSegment(SwSurface* surface, const SwImage
int32_t dw = surface->stride;
int32_t x1, x2, x, y, ar, ab, iru, irv, px, ay;
int32_t vv = 0, uu = 0;
int32_t minx = INT32_MAX, maxx = INT32_MIN;
int32_t minx = INT32_MAX, maxx = 0;
float dx, u, v, iptr;
uint32_t* buf;
SwSpan* span = nullptr; //used only when rle based.
@ -310,7 +310,7 @@ static void _rasterBlendingPolygonImageSegment(SwSurface* surface, const SwImage
if (!region) {
minx = INT32_MAX;
maxx = INT32_MIN;
maxx = 0;
//one single row, could be consisted of multiple spans.
while (span->y == y && spanIdx < image->rle->size) {
if (minx > span->x) minx = span->x;
@ -458,7 +458,7 @@ static void _rasterPolygonImageSegment(SwSurface* surface, const SwImage* image,
int32_t dw = surface->stride;
int32_t x1, x2, x, y, ar, ab, iru, irv, px, ay;
int32_t vv = 0, uu = 0;
int32_t minx = INT32_MAX, maxx = INT32_MIN;
int32_t minx = INT32_MAX, maxx = 0;
float dx, u, v, iptr;
uint32_t* buf;
SwSpan* span = nullptr; //used only when rle based.
@ -492,7 +492,7 @@ static void _rasterPolygonImageSegment(SwSurface* surface, const SwImage* image,
if (!region) {
minx = INT32_MAX;
maxx = INT32_MIN;
maxx = 0;
//one single row, could be consisted of multiple spans.
while (span->y == y && spanIdx < image->rle->size) {
if (minx > span->x) minx = span->x;