|
@@ -663,13 +663,18 @@ void ValidateDSProcess::Validate( const aiMaterial* pMaterial)
|
|
}
|
|
}
|
|
// check all predefined types
|
|
// check all predefined types
|
|
if (aiPTI_String == prop->mType) {
|
|
if (aiPTI_String == prop->mType) {
|
|
- // FIX: strings are now stored in a less expensive way ...
|
|
|
|
- if (prop->mDataLength < 5 || prop->mDataLength < 4 + *reinterpret_cast<uint32_t*>(prop->mData) + 1) {
|
|
|
|
|
|
+ // FIX: strings are now stored in a less expensive way, but we can't use the
|
|
|
|
+ // validation routine for 'normal' aiStrings
|
|
|
|
+ uint32_t len;
|
|
|
|
+ if (prop->mDataLength < 5 || prop->mDataLength < 4 + (len=*reinterpret_cast<uint32_t*>(prop->mData)) + 1) {
|
|
ReportError("aiMaterial::mProperties[%i].mDataLength is "
|
|
ReportError("aiMaterial::mProperties[%i].mDataLength is "
|
|
"too small to contain a string (%i, needed: %i)",
|
|
"too small to contain a string (%i, needed: %i)",
|
|
i,prop->mDataLength,sizeof(aiString));
|
|
i,prop->mDataLength,sizeof(aiString));
|
|
}
|
|
}
|
|
- Validate((const aiString*)prop->mData);
|
|
|
|
|
|
+ if(prop->mData[prop->mDataLength-1]) {
|
|
|
|
+ ReportError("Missing null-terminator in string material property");
|
|
|
|
+ }
|
|
|
|
+ // Validate((const aiString*)prop->mData);
|
|
}
|
|
}
|
|
else if (aiPTI_Float == prop->mType) {
|
|
else if (aiPTI_Float == prop->mType) {
|
|
if (prop->mDataLength < sizeof(float)) {
|
|
if (prop->mDataLength < sizeof(float)) {
|