Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch for 1.3.2 #24

Open
wants to merge 1 commit into
base: origin-1.3.2-1733941040
Choose a base branch
from
Open
Show file tree
Hide file tree
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: 6 additions & 2 deletions src/FileFace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ FileFace::FileFace(const char *filename)
if (!TtfUtil::GetTableDirInfo(_header_tbl, tbl_offset, tbl_len)) return;
_table_dir = (TtfUtil::Sfnt::OffsetSubTable::Entry*)gralloc<char>(tbl_len);
if (fseek(_file, tbl_offset, SEEK_SET)) return;
if (_table_dir)
if (fread(_table_dir, 1, tbl_len, _file) != tbl_len) return;
if (_table_dir && fread(_table_dir, 1, tbl_len, _file) != tbl_len)
{
free(_table_dir);
_table_dir = NULL;
}
return;
}

FileFace::~FileFace()
Expand Down
4 changes: 3 additions & 1 deletion src/Pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ bool Pass::readPass(const byte * const pass_start, size_t pass_length, size_t su
if (e.test(pass_length < 40, E_BADPASSLENGTH)) return face.error(e);
// Read in basic values
const byte flags = be::read<byte>(p);
if (e.test((flags & 0x1f) && pt < PASS_TYPE_POSITIONING, E_BADCOLLISIONPASS))
if (e.test((flags & 0x1f) &&
(pt < PASS_TYPE_POSITIONING || !m_silf->aCollision() || !face.glyphs().hasBoxes()),
E_BADCOLLISIONPASS))
return face.error(e);
m_numCollRuns = flags & 0x7;
m_kernColls = (flags >> 3) & 0x3;
Expand Down
1 change: 1 addition & 0 deletions src/inc/GlyphCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class GlyphCache
const SlantBox & getSubBoundingSlantBox(unsigned short glyphid, uint8 subindex) const;
const BBox & getSubBoundingBBox(unsigned short glyphid, uint8 subindex) const;
bool check(unsigned short glyphid) const;
bool hasBoxes() const { return _boxes != 0; }

CLASS_NEW_DELETE;

Expand Down