diff options
| author | Alexander Golubev <fatzer2@gmail.com> | 2026-03-18 13:35:30 +0300 |
|---|---|---|
| committer | Alexander Golubev <fatzer2@gmail.com> | 2026-03-18 13:53:58 +0300 |
| commit | a04969affec3486045cfc954bda59d1a3217e319 (patch) | |
| tree | adcc833faffba105c94b94b10e9a8a6e1e81e317 /src/kernel/tqfontengine_x11.cpp | |
| parent | 6ec5d7ec4ff7cfbb52866b28c8b36e5ea3ee31d1 (diff) | |
| download | tqt-a04969affec3486045cfc954bda59d1a3217e319.tar.gz tqt-a04969affec3486045cfc954bda59d1a3217e319.zip | |
Fix infinite looping in TQTextEngine::shape()
With certain characters a loop inside TQTextEngine::shape() could
repeat forever because some script engines were requesting more memory
because of a mistake.
In particular this were observed with at least letters "ई" (U+0908,
DEVANAGARI LETTER II) and "ༀ" (U+0F00, TIBETAN SYLLABLE OM).
The problem was already solved in Qt somewhere between last Qt3 release
and first Qt4. But due to no public VCS is available it's impossible to
pinpoint an exact commit. This patch is heavily based on the Qt-4.3.5
code.
Closes: https://mirror.git.trinitydesktop.org/gitea/TDE/tqt/issues/270
Bug: https://mirror.git.trinitydesktop.org/gitea/TDE/tdeutils/issues/93
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
Diffstat (limited to 'src/kernel/tqfontengine_x11.cpp')
| -rw-r--r-- | src/kernel/tqfontengine_x11.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/kernel/tqfontengine_x11.cpp b/src/kernel/tqfontengine_x11.cpp index 1a7b95ebb..7f514f914 100644 --- a/src/kernel/tqfontengine_x11.cpp +++ b/src/kernel/tqfontengine_x11.cpp @@ -2428,7 +2428,7 @@ bool TQOpenType::shape(TQShaperItem *item, const unsigned int *properties) return true; } -bool TQOpenType::positionAndAdd(TQShaperItem *item, bool doLogClusters) +bool TQOpenType::positionAndAdd(TQShaperItem *item, int availableGlyphs, bool doLogClusters) { if (gpos) { #ifdef TQ_WS_X11 @@ -2444,7 +2444,7 @@ bool TQOpenType::positionAndAdd(TQShaperItem *item, bool doLogClusters) } // make sure we have enough space to write everything back - if (item->num_glyphs < (int)otl_buffer->in_length) { + if (availableGlyphs < (int)otl_buffer->in_length) { item->num_glyphs = otl_buffer->in_length; return false; } |
