Skip to content

Commit

Permalink
Add missing check.
Browse files Browse the repository at this point in the history
  • Loading branch information
flanglet committed Nov 27, 2020
1 parent 6e64192 commit 291a91d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions function/FSDCodec.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ func (this *FSDCodec) Forward(src, dst []byte) (uint, uint, error) {
}
}

if minIdx == 0 {
return 0, 0, fmt.Errorf("FSD forward transform skip")
}

// If not 'better enough', quick exit
if this.isFast == true && ent[minIdx] >= (123*ent[0])>>7 {
return 0, 0, fmt.Errorf("FSD forward transform skip")
Expand Down

0 comments on commit 291a91d

Please sign in to comment.