After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 171170 - Wrong return core in Do_Glyph_Lookup causes infinite loops
Wrong return core in Do_Glyph_Lookup causes infinite loops
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
unspecified
Other All
: Normal critical
: 1.8.2
Assigned To: pango-maint
pango-maint
: 161327 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-03-22 04:13 UTC by Behdad Esfahbod
Modified: 2005-07-26 18:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix. (1.80 KB, patch)
2005-03-22 04:15 UTC, Behdad Esfahbod
none Details | Review
New patch. (2.67 KB, patch)
2005-03-22 04:41 UTC, Behdad Esfahbod
none Details | Review
Revised patch. (5.81 KB, patch)
2005-07-26 14:41 UTC, Behdad Esfahbod
none Details | Review

Description Behdad Esfahbod 2005-03-22 04:13:21 UTC
In opentype code in both ftxgsub.c and ftxgpos.c, Do_Glyph_Lookup is supposed to
return TTO_Err_Not_Covered if a lookup is not performed, but if the LookupType
is out of range, then a TT_Err_Ok is returned.

This bug hit when trying to use font Nesf2.  The dump of the font doesn't look
bad, but debugging shows a LookupType of 17 in the memory, so I expect to find
another bug which is causing that, but this bug is a bug and should be fixed
anyway.  Note that my optimizations in bug 170414 fix this bug too.
Comment 1 Behdad Esfahbod 2005-03-22 04:15:16 UTC
Created attachment 39048 [details] [review]
Patch to fix.

The patch is trivial.  Please apply to HEAD and branches.
Comment 2 Behdad Esfahbod 2005-03-22 04:41:31 UTC
Created attachment 39049 [details] [review]
New patch.

Ok, the other problem is that if a font contains a lookup index for which no
lookup exists, the lookup should be ignored.  This patch contains both fixes
and obsoletes the first patch.
Comment 3 Owen Taylor 2005-07-25 16:48:03 UTC
The patches look OK to me, but see also:

 TT_{GSUB,GPOS}_Add_Feature

and (for lookup indices coming from other places)

 Do_ContextSubst, Do_ContextPos

If you do the latter two, you probably can close bug 161327, since
we don't really need to check when loading *and* when applying the
features.
Comment 4 Behdad Esfahbod 2005-07-26 14:41:22 UTC
Created attachment 49782 [details] [review]
Revised patch.

Checks are done at every point we lookup a lookup :)
Comment 5 Owen Taylor 2005-07-26 18:34:34 UTC
Applied your patch with one change - you didn't have a check in
ftxpos.c:Do_Glyph_Lookup()

2005-07-26    Owen Taylor  <otaylor@redhat.com>

        * pango/opentype/ftxgsub.c, pango/opentype/ftxgpos.c: Skip lookups
        with lookup index out of range. (Patch from Behdad Esfahbod, #171170)

Comment 6 Owen Taylor 2005-07-26 18:35:27 UTC
*** Bug 161327 has been marked as a duplicate of this bug. ***