freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Bug in ftcbits.c


From: Knut St. Osmundsen
Subject: [Devel] Bug in ftcbits.c
Date: Sun, 22 Jun 2003 22:59:57 +0200
User-agent: Mozilla/5.0 (OS/2; U; Warp 4.5; en-US; rv:1.2.1) Gecko/20021201

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




reply via email to

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