fixes some bug
Some checks failed
CodeQL / Analyze (go) (push) Has been cancelled
Go / Test (1.22) (push) Has been cancelled
Go / Test (^1.22) (push) Has been cancelled

This commit is contained in:
2025-08-26 23:38:23 +08:00
parent 7b60edc248
commit 540ba15e83
3 changed files with 21 additions and 13 deletions

View File

@ -142,12 +142,14 @@ func (p *PaletteContainer[T]) ReadFrom(r io.Reader) (n int64, err error) {
return n, err
}
p.data = NewBitStorage(p.bits, p.data.length, nil)
nn, err = p.data.ReadFrom(r)
n += nn
if err != nil {
return n, err
}
return n, p.data.Fix(p.bits)
return n, nil
}
func (p *PaletteContainer[T]) WriteTo(w io.Writer) (n int64, err error) {