From 467689a441c11d411b570e5115487fae6f314424 Mon Sep 17 00:00:00 2001 From: Sorrow446 <47045733+Sorrow446@users.noreply.github.com> Date: Mon, 1 Jan 2024 01:34:10 +0000 Subject: [PATCH] https://github.com/Sorrow446/go-mp4tag/issues/10 fix https://github.com/Sorrow446/go-mp4tag/issues/10 --- write.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/write.go b/write.go index 2593feb..c05b3f7 100644 --- a/write.go +++ b/write.go @@ -351,8 +351,7 @@ func (mp4 MP4) readToOffset(f *os.File, startOffset int64) error { readI64 := int64(read) totalRead += readI64 if totalRead > startOffset { - // Okay? - _, err = f.Write(buf[:totalRead-readI64+startOffset]) + _, err = f.Write(buf[:readI64+startOffset-totalRead]) if err != nil { return err }