Skip to content

Reachable assertion / abort in whisper_model_load() on an invalid ftype #3924

Description

@professor-moody

whisper_model_load() (src/whisper.cpp) passes a model-declared ftype to ggml_ftype_to_ggml_type() (ggml/src/ggml.c:1410). An invalid ftype (e.g. 5, 6, or ≥27 after %1000) sets wtype = GGML_TYPE_COUNT as an error sentinel, then a GGML_ASSERT immediately fires on that value and calls ggml_abort() — the caller's error handler is dead code.

GGML_ASSERT is not compiled out under -DNDEBUG, so this aborts release builds as well.

Confirmed on: commit 95ea8f9b, x86_64. 48-byte PoC available on request.

Suggested fix: return a load error on an unrecognized ftype instead of asserting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions