freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] A suspicious memory leak in src/truetype/ttgload.c: tt_loader_i


From: Grissiom
Subject: Re: [ft] A suspicious memory leak in src/truetype/ttgload.c: tt_loader_init
Date: Tue, 19 May 2015 18:10:47 +0800

Hi Werner,

I got some clue. The leak is caused by this piece of code in ttinterp.c:

================================================
    /* If any errors have occurred, function tables may be broken. */
    /* Force a re-execution of `prep' and `fpgm' tables if no      */
    /* bytecode debugger is run.                                   */
    if ( CUR.error
         && !CUR.instruction_trap
         && CUR.curRange == tt_coderange_glyph )
    {
      FT_TRACE1(( "  The interpreter returned error 0x%x\n", CUR.error ));
      exc->size->bytecode_ready = -1;
      exc->size->cvt_ready      = -1;
    }
=================================================

So if any error happened in TT_RunIns, the code only clear the ready statues but forgot to free the spaces allocated in `size`.

However, the relative code is rather complicated and I could not figure out how to cleanup the `size` in a right way...

--
Cheers,
Grissiom

reply via email to

[Prev in Thread] Current Thread [Next in Thread]