diff --git a/projects/clr/hipamd/src/hip_graph.cpp b/projects/clr/hipamd/src/hip_graph.cpp index 90b30544f9..3c3257536c 100644 --- a/projects/clr/hipamd/src/hip_graph.cpp +++ b/projects/clr/hipamd/src/hip_graph.cpp @@ -371,6 +371,9 @@ hipError_t hipStreamEndCapture(hipStream_t stream, hipGraph_t* pGraph) { hipError_t hipGraphCreate(hipGraph_t* pGraph, unsigned int flags) { HIP_INIT_API(hipGraphCreate, pGraph, flags); + if ((pGraph == nullptr) || (flags != 0)) { + HIP_RETURN(hipErrorInvalidValue); + } *pGraph = new ihipGraph(); HIP_RETURN(hipSuccess); }