Skip to content

[rmodels] LoadModel() Model exported from Blender with Draco compression enabled results in a crash #5567

@charlie-sans

Description

@charlie-sans

Please, before submitting a new issue verify and check:

  • I tested it on latest raylib version from master branch
  • I checked there is no similar issue already reported
  • I checked the documentation on the wiki
  • My code has no errors or misuse of raylib

Issue description

when loading a GLB model file that has been exported from blender with Draco Compression enabled in the
export settings, Raylib segfaults during the loading of mesh data.

The GLTF spec says extensionsRequired must be honored, but raylib currently doesn’t support KHR_draco_mesh_compression.

Environment

Windows 11 64 bit & linux 64 bit (arch distro)

Issue Screenshot

here's what my program under gdb looks like.
Image

Code Example

#include <raylib.h>

int main(void)
{
    // Initialize window and OpenGL context
    InitWindow(800, 450, "raylib GLB Draco crash test");

    // Try to load Draco‑compressed model
    Model model = LoadModel("world_draco_compressed.glb");

    // If model.meshCount < 0 something went wrong, but mostly should segfault when loading the model at all.
    TraceLog(LOG_INFO, "Loaded model meshCount: %d", model.meshCount);

    // Main loop just stays open so loader runs
    while (!WindowShouldClose())
    {
        BeginDrawing();
            ClearBackground(RAYWHITE);
        EndDrawing();
    }

    UnloadModel(model);
    CloseWindow();

    return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions