diff --git a/ocf/ocf.go b/ocf/ocf.go index 7c2a05c..b3d7408 100644 --- a/ocf/ocf.go +++ b/ocf/ocf.go @@ -187,7 +187,8 @@ func (d *Decoder) readBlock() int64 { size := d.reader.ReadLong() // Read the blocks data - if count > 0 { + switch { + case count > 0: data := make([]byte, size) d.reader.Read(data) @@ -197,6 +198,11 @@ func (d *Decoder) readBlock() int64 { } d.resetReader.Reset(data) + + case size > 0: + // Skip the block data when count is 0 + data := make([]byte, size) + d.reader.Read(data) } // Read the sync.