bugThe FreeType Project - Bugs: bug #25124, Bug in src\autofit\afcjk.c...

 
 

bug #25124: Bug in src\autofit\afcjk.c af_cjk_hint_edges() when call FT_MulDiv

Submitted by:  Hongbo Ni <hongbo>
Submitted on:  Fri 19 Dec 2008 07:52:38 AM UTC  
 
Severity: 3 - NormalItem Group: Incorrect behaviour
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.3.8

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 21 Dec 2008 09:46:17 AM UTC, comment #2:

Applied, thanks!

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Fri 19 Dec 2008 11:18:11 AM UTC, comment #1:

I also find there are another two FT_MulDiv calls that needs to be fixed in aflatin.c & aflatin2.c.

Full patch is attached.

(file #17092)

Hongbo Ni <hongbo>
Fri 19 Dec 2008 07:52:38 AM UTC, original submission:

Because FT_MulDiv(a,b,c) returns 0x7fffffff when c=0,
the code causes edge->pos to be a large negative number
when after->fpos == before->fpos.

Following is the patch I have coded for v2.3.7
src\autofit\afcjk.c af_cjk_hint_edges().
Hope someone will apply it.

In the same time, all calls to FT_MulDiv should be checked.

@@ -1253,10 +1253,15 @@
else if ( after >= edge_limit )
af_cjk_align_serif_edge( hints, before, edge );
else
- edge->pos = before->pos +
- FT_MulDiv( edge->fpos - before->fpos,
- after->pos - before->pos,
- after->fpos - before->fpos );
+ {
+ if ( after->fpos == before->fpos ) /FT_MulDiv returns 0x7FFFFFFF when div 0 /
+ edge->pos = before->pos;
+ else
+ edge->pos = before->pos +
+ FT_MulDiv( edge->fpos - before->fpos,
+ after->pos - before->pos,
+ after->fpos - before->fpos );
+ }
}
}

Hongbo Ni <hongbo>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #17092:  FT_MulDiv--fix.patch added by hongbo (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by wl (Posted a comment)
  • -unavailable- added by hongbo (Submitted the item)
  • -unavailable- added by hongbo
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 21 Dec 2008 09:46:17 AM UTCwlStatusNone=>Fixed
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.3.8
      SummaryBug in src\\autofit\\afcjk.c af_cjk_hint_edges() when call FT_MulDiv=>Bug in src\autofit\afcjk.c af_cjk_hint_edges() when call FT_MulDiv
    Fri 19 Dec 2008 11:18:11 AM UTChongboAttached File-=>Added FT_MulDiv--fix.patch, #17092
    Fri 19 Dec 2008 07:52:38 AM UTChongboCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1