Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/FontLib/BinaryStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,13 @@ public function write($data, $length = null) {
}

public function readUInt8() {
return ord($this->read(1));
$uint8 = $this->read(1);

if ($uint8 === '') {
$uint8 = '0';
Copy link
Member

@bsweeney bsweeney Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you default to the string '0' if there's no data. ord('0') returns a value of 48. The equivalent behavior for an empty string would be to just return 0, no need to call the ord function.

}

return ord($uint8);
}

public function readUInt8Many($count) {
Expand Down