Fix memory corruption in the aiGetExportFormatDescription() API. Clarify Exporter doc.

This commit is contained in:
Alexander Gessler
2014-06-17 16:10:55 +02:00
parent 75fd29ac19
commit be5fc42e16
3 changed files with 21 additions and 2 deletions

View File

@@ -436,6 +436,11 @@ const aiExportFormatDesc* Exporter :: GetExportFormatDescription( size_t pIndex
if (pIndex >= GetExportFormatCount()) {
return NULL;
}
// Return from static storage if the requested index is built-in.
if (pIndex < sizeof(gExporters) / sizeof(gExporters[0])) {
return &gExporters[pIndex].mDescription;
}
return &pimpl->mExporters[pIndex].mDescription;
}