From da013350f9f9cfa6b89f5fe8f36c669b3f37bb66 Mon Sep 17 00:00:00 2001 From: Yotam Gingold Date: Mon, 23 Nov 2015 23:50:25 -0500 Subject: [PATCH] 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. --- code/AssimpCExport.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/AssimpCExport.cpp b/code/AssimpCExport.cpp index 6df99d86b..2d40abc22 100644 --- a/code/AssimpCExport.cpp +++ b/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; }