possible fix for rare panic

This commit is contained in:
ston1th 2022-10-08 13:45:12 +02:00
commit 88861102fd
4 changed files with 20 additions and 17 deletions

View file

@ -163,7 +163,7 @@ func (f *file) ReadAt(p []byte, pos int64) (n int, err error) {
defer f.rmu.Unlock()
cn, _, roff := align(pos)
var last bool
if f.r.cn != cn {
if f.r.cn != cn || roff >= int64(len(f.r.unread)) {
_, err = f.Seek(pos, io.SeekStart)
if err != nil {
return