소스 검색

aiGetExportFormatDescription() no longer uses free'd memory

aiGetExportFormatDescription() now creates an Exporter object at the beginning of the function, so that a call to `GetExportFormatDescription()` doesn't access free'd memory.
Yotam Gingold 9 년 전
부모
커밋
da013350f9
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      code/AssimpCExport.cpp

+ 2 - 1
code/AssimpCExport.cpp

@@ -63,7 +63,8 @@ ASSIMP_API const aiExportFormatDesc* aiGetExportFormatDescription( size_t index)
 {
     // Note: this is valid as the index always pertains to a built-in exporter,
     // for which the returned structure is guaranteed to be of static storage duration.
-    const aiExportFormatDesc* orig( Exporter().GetExportFormatDescription( index ) );
+    Exporter exporter;
+    const aiExportFormatDesc* orig( exporter.GetExportFormatDescription( index ) );
     if (NULL == orig) {
         return NULL;
     }