]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
gguf : harden loader against malformed tensor dims and metadata types (llama/25596)
authorHarrisonSec <redacted>
Wed, 12 Aug 2026 12:07:48 +0000 (05:07 -0700)
committerGeorgi Gerganov <redacted>
Fri, 14 Aug 2026 19:16:06 +0000 (22:16 +0300)
commitb0e3297169ca5a3e968776057de57727be955a16
tree75d849ff50e00fc7b4e821f4c2784c9cafbd7324
parent92423afd20f26eda9b8421ceee74e34da80119a0
gguf : harden loader against malformed tensor dims and metadata types (llama/25596)

* gguf : harden loader against malformed tensor dims and metadata types

* gguf: address review on malformed-metadata hardening

- report the expected vs. actual type when general.alignment is not u32
- use ggml_nelements() > 0 for the zero-element guard and keep the
  representability checks visually aligned
- add test-gguf cases for a wrong-typed alignment key and a zero-dim
  tensor (both used to crash: assert-abort and SIGFPE respectively)

Ran tests/test-gguf: 164/164 pass. Used an AI assistant to help draft
these edits; reviewed and verified by me.

* cont : less comments

Co-authored-by: Georgi Gerganov <redacted>
---------

Co-authored-by: Georgi Gerganov <redacted>
ggml/src/gguf.cpp