From: Hermet Park Date: Thu, 18 Nov 2021 02:31:15 +0000 (+0900) Subject: common shape: fix memory access violation X-Git-Tag: accepted/tizen/unified/20211125.144739~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5518d9ea0ff3a395f44fd3170085126040976ecf;p=platform%2Fcore%2Fgraphics%2Ftizenvg.git common shape: fix memory access violation asan report: ../src/lib/tvgShapeImpl.h:94:15: runtime error: null pointer passed as argument 2, which is declared to never be null ../src/lib/tvgShapeImpl.h:101:15: runtime error: null pointer passed as argument 2, which is declared to never be null --- diff --git a/src/lib/tvgShapeImpl.h b/src/lib/tvgShapeImpl.h index c887f049..32aa00a 100644 --- a/src/lib/tvgShapeImpl.h +++ b/src/lib/tvgShapeImpl.h @@ -84,6 +84,8 @@ struct ShapePath void duplicate(const ShapePath* src) { + if (src->cmdCnt == 0 || src->ptsCnt == 0) return; + cmdCnt = src->cmdCnt; reservedCmdCnt = src->reservedCmdCnt; ptsCnt = src->ptsCnt;