dompdf / php-font-lib

A library to read, parse, export and make subsets of different types of font files.
GNU Lesser General Public License v2.1
1.74k stars 255 forks source link

Undefined offset #50

Closed tostercx closed 7 years ago

tostercx commented 8 years ago

Hi,

I sometimes get undefined offsets at this line: https://github.com/PhenX/php-font-lib/blob/0.4/src/FontLib/BinaryStream.php#L379

Happened when using Dompdf with font stripping turned on with bold Times New Roman. It seems to work correctly if I check if $data[$i] is set and return null otherwise.

$ret += $this->w($type[0], isset($data[$i]) ? $data[$i] : null);

PhenX commented 7 years ago

Fixed by 010c3e0e22a9ab0d9f93678692c80865f041e2d2