[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freetype-devel
Subject:    [Devel] Bug in ftcbits.c
From:       "Knut St. Osmundsen" <bird-freetype () anduin ! net>
Date:       2003-06-22 20:59:57
[Download RAW message or body]

Hi.

At line 306:
       if ( sbit->buffer == NULL && sbit->width != 255 )
       {
         FT_ULong  size;


         /* yes, it's safe to ignore errors here */
         ftc_sbit_node_load( snode,
                             cache->manager,
                             FTC_SBIT_FAMILY( FTC_QUERY( squery )->family ),
                             gindex,
                             &size );

         cache->manager->cur_weight += size;
       }

The comment is wrong, it's not safe to ignore errors here, because size might 
now be set in the case on of an error and will carbage cur_weight. This lead, in 
my case, to the cache to be emptied and hence pretty much useless.

The fix is to check for success before using size.

Kind Regards,
  knut


_______________________________________________
Devel mailing list
Devel@freetype.org
http://www.freetype.org/mailman/listinfo/devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic