Skip to content

Commit

Permalink
prevent panic
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Charvin committed Nov 18, 2019
1 parent 52d82c2 commit c4685a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fpdf.go
Original file line number Diff line number Diff line change
Expand Up @@ -2707,6 +2707,10 @@ func (f *Fpdf) MultiCell(w, h float64, txtStr, borderStr, alignStr string, fill
ls = l
ns++
}
if int(c) >= len(cw) {
f.err = fmt.Errorf("character outside the supported range: %s", string(c))
return
}
if cw[int(c)] == 0 { //Marker width 0 used for missing symbols
l += f.currentFont.Desc.MissingWidth
} else if cw[int(c)] != 65535 { //Marker width 65535 used for zero width symbols
Expand Down

0 comments on commit c4685a7

Please sign in to comment.