From 0ec0e638355ee804836c569edc7dd6d1d17c0308 Mon Sep 17 00:00:00 2001 From: turly221 Date: Wed, 11 Dec 2024 18:17:18 +0000 Subject: [PATCH] commit patch 27654116 --- src/FileFace.cpp | 8 ++++++-- src/Pass.cpp | 4 +++- src/inc/GlyphCache.h | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/FileFace.cpp b/src/FileFace.cpp index 43aff71a..d1510d3e 100644 --- a/src/FileFace.cpp +++ b/src/FileFace.cpp @@ -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(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() diff --git a/src/Pass.cpp b/src/Pass.cpp index c1764b35..c68e8343 100644 --- a/src/Pass.cpp +++ b/src/Pass.cpp @@ -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(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; diff --git a/src/inc/GlyphCache.h b/src/inc/GlyphCache.h index cf7c2469..3c0add58 100644 --- a/src/inc/GlyphCache.h +++ b/src/inc/GlyphCache.h @@ -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;