Merge pull request #4085 from assimp/kimkulling-issue_3442
Fix possible nullptr dereferencing in material parsingpull/4086/head
commit
590307dba9
|
@ -232,6 +232,12 @@ void ObjFileMtlImporter::getIlluminationModel(int &illum_model) {
|
|||
// Loads a single float value.
|
||||
void ObjFileMtlImporter::getFloatValue(ai_real &value) {
|
||||
m_DataIt = CopyNextWord<DataArrayIt>(m_DataIt, m_DataItEnd, &m_buffer[0], BUFFERSIZE);
|
||||
size_t len = std::strlen(&m_buffer[0]);
|
||||
if (0 == len) {
|
||||
value = 0.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
value = (ai_real)fast_atof(&m_buffer[0]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue