Commit Graph

2 Commits

Author SHA1 Message Date
LP
522c703bb9 fuzz: Fix memory leak in ForceFormat helper (#6435)
The ForceFormat function unregisters importers from the Importer
but doesn't delete them, causing memory leaks detected by ASan
during OSS-Fuzz check_build.

When UnregisterLoader is called, the importer is removed from the
internal list but the memory is not freed. Since the Importer
originally allocated these objects and we're removing them from
its management, we must delete them explicitly.

Also include BaseImporter.h to ensure complete type information
is available for proper deletion.

This fixes OSS-Fuzz check_build failures for all format-specific
fuzzers (obj, gltf, glb, fbx, collada, stl).
2026-01-09 11:02:21 +01:00
LP
ae6f477604 Fuzzing: Add OSS-Fuzz integration and multiple format-specific fuzzers (#6429)
* fuzz: Add OSS-Fuzz integration and multiple format-specific fuzzers

* fuzz: Add GLB fuzzer and fix null pointer issue

- Add null check for mFileExtensions in ForceFormat() to prevent
  undefined behavior when the field is null
- Fix misleading comment in gltf fuzzer (only covers text format)
- Add separate GLB fuzzer for binary glTF format coverage
- Update OSS-Fuzz build script to include GLB fuzzer with corpus

* Add copyright and licensing information

Added licensing information and copyright notice to fuzzer_common.h

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-12-23 19:31:27 +01:00