Skip to content

Commit

Permalink
fix: add handling to skip block data in ocf decoder readBlock method (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lukrah authored Jan 24, 2025
1 parent 68046a4 commit 4ba9c73
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ocf/ocf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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.
Expand Down

0 comments on commit 4ba9c73

Please sign in to comment.