This commit is contained in:
ylwango613 2026-01-06 08:25:49 +01:00 committed by GitHub
commit 918205c2bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -237,6 +237,11 @@ func (llm *gguf) Decode(rs io.ReadSeeker) error {
alignment := llm.kv.Uint("general.alignment", 32)
// Validate alignment
if alignment == 0 {
return fmt.Errorf("invalid general.alignment: cannot be zero")
}
offset, err := rs.Seek(0, io.SeekCurrent)
if err != nil {
return err