Skip to content
Snippets Groups Projects
Commit 0d4185f2 authored by Mark Winter's avatar Mark Winter
Browse files

Fixed mexHashData crash when an empty struct or cell element was hashed.

parent 041d1fd0
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -185,6 +185,15 @@ void hashStructArray(SHA1Context* pShaContext, const mxArray* pData)
void hashData(SHA1Context* pShaContext, const mxArray* pData)
{
// If the data pointer is null (e.g. empty cells/structs)
// then just hash the NULL pointer
if ( pData == NULL )
{
hashElementData<const mxArray*>(pShaContext, &pData, 1);
return;
}
mxClassID classID = mxGetClassID(pData);
switch (classID)
......@@ -248,7 +257,7 @@ void hashData(SHA1Context* pShaContext, const mxArray* pData)
case mxVOID_CLASS:
case mxUNKNOWN_CLASS:
default:
mexErrMsgTxt("Cannot hash data of unkown or void class");
mexErrMsgTxt("Cannot hash data of unknown or void class");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment