Skip to content

Commit

Permalink
Disable logs for fuzzer by default (assimp#5938)
Browse files Browse the repository at this point in the history
Co-authored-by: Kim Kulling <[email protected]>
  • Loading branch information
tyler92 and kimkulling authored Dec 25, 2024
1 parent 258cdfd commit 7bd54e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fuzz/assimp_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using namespace Assimp;

extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) {
#ifdef _DEBUG
aiLogStream stream = aiGetPredefinedLogStream(aiDefaultLogStream_STDOUT, nullptr);
aiAttachLogStream(&stream);
#endif

Importer importer;
const aiScene *sc = importer.ReadFileFromMemory(data, dataSize,
Expand All @@ -61,7 +63,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataSize) {
Exporter exporter;
exporter.ExportToBlob(sc, "fbx");

#ifdef _DEBUG
aiDetachLogStream(&stream);
#endif

return 0;
}
Expand Down

0 comments on commit 7bd54e3

Please sign in to comment.