Skip to content

Commit

Permalink
Convert zero value returned by encode() into error
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Kim committed Dec 7, 2018
1 parent 5459ed8 commit e8f6b1c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/impl/libraptorq/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ func (enc *Encoder) Encode(sbn uint8, esi uint32, buf []byte) (written uint, err
err = errors.New("RaptorQ encoder buffer too small")
} else {
written = uint(enc.wrapped.Encode(buf, esi, sbn))
if written == 0 {
err = errors.New("RaptorQ encoder returned an error indication")
}
}
return
}
Expand Down

0 comments on commit e8f6b1c

Please sign in to comment.