Add missing null-check to msdf_shape_orient_contours function

This commit is contained in:
KitsuneAlex 2024-05-11 02:06:40 +02:00
parent bc14445bd0
commit 3f68e015e5
No known key found for this signature in database
GPG Key ID: 6B0CE864BB69B7D0
1 changed files with 3 additions and 0 deletions

View File

@ -282,6 +282,9 @@ MSDF_API int msdf_shape_bound_miters(msdf_shape_const_handle shape,
} }
MSDF_API int msdf_shape_orient_contours(msdf_shape_handle shape) { MSDF_API int msdf_shape_orient_contours(msdf_shape_handle shape) {
if(shape == nullptr) {
return MSDF_ERR_INVALID_ARG;
}
reinterpret_cast<msdfgen::Shape*>(shape)->orientContours(); reinterpret_cast<msdfgen::Shape*>(shape)->orientContours();
return MSDF_SUCCESS; return MSDF_SUCCESS;
} }