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
This commit is contained in:
Hermet Park 2021-11-18 11:31:15 +09:00 committed by Hermet Park
parent 823cc85238
commit e90f040208

View file

@ -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;