sw_engine SwShape: Prevent null access
authorJunsuChoi <jsuya.choi@samsung.com>
Wed, 15 Dec 2021 04:19:14 +0000 (20:19 -0800)
committerJunsuChoi <jsuya.choi@samsung.com>
Wed, 15 Dec 2021 06:37:57 +0000 (22:37 -0800)
strokeOutline returned strokeExportOutline() is the address of mpool->strokeOutline[idx].
Assuming this value is null, mpoolRetStrokeOutline on line 617 will access mpool->strokeOutline[idx].
Logically, the logic of the mpool* functions does not occur in this case.

src/lib/sw_engine/tvgSwShape.cpp

index 29f5590..ca5548c 100644 (file)
@@ -594,10 +594,6 @@ bool shapeGenStrokeRle(SwShape* shape, const Shape* sdata, const Matrix* transfo
     }
 
     strokeOutline = strokeExportOutline(shape->stroke, mpool, tid);
-    if (!strokeOutline) {
-        ret = false;
-        goto fail;
-    }
 
     if (!mathUpdateOutlineBBox(strokeOutline, clipRegion, renderRegion, false)) {
         ret = false;