mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-28 09:05:52 +00:00
capi: added pointer validation
This commit is contained in:
parent
f24409a76d
commit
280d27ac83
2 changed files with 2 additions and 2 deletions
|
@ -777,7 +777,7 @@ TVG_EXPORT Tvg_Result tvg_paint_translate(Tvg_Paint* paint, float x, float y);
|
|||
*
|
||||
* \return Tvg_Result enumeration.
|
||||
* \retval TVG_RESULT_SUCCESS Succeed.
|
||||
* \retval TVG_RESULT_INVALID_ARGUMENT An invalid Tvg_Paint pointer.
|
||||
* \retval TVG_RESULT_INVALID_ARGUMENT A @c nullptr is passed as the argument.
|
||||
* \retval TVG_RESULT_FAILED_ALLOCATION An internal error with memory allocation.
|
||||
*/
|
||||
TVG_EXPORT Tvg_Result tvg_paint_transform(Tvg_Paint* paint, const Tvg_Matrix* m);
|
||||
|
|
|
@ -166,7 +166,7 @@ TVG_EXPORT Tvg_Result tvg_paint_translate(Tvg_Paint* paint, float x, float y)
|
|||
|
||||
TVG_EXPORT Tvg_Result tvg_paint_transform(Tvg_Paint* paint, const Tvg_Matrix* m)
|
||||
{
|
||||
if (!paint) return TVG_RESULT_INVALID_ARGUMENT;
|
||||
if (!paint || !m) return TVG_RESULT_INVALID_ARGUMENT;
|
||||
return (Tvg_Result) reinterpret_cast<Paint*>(paint)->transform(*(reinterpret_cast<const Matrix*>(m)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue