freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] [sfnt] Avoid undefined shifts in `COLR`


From: Werner Lemberg (@wl)
Subject: [Git][freetype/freetype][master] [sfnt] Avoid undefined shifts in `COLR` v1 color line retrieval
Date: Fri, 26 Aug 2022 14:16:28 +0000

Werner Lemberg pushed to branch master at FreeType / FreeType

Commits:

  • 4797b2ff
    by Dominik Röttsches at 2022-08-26T12:08:34+03:00
    [sfnt] Avoid undefined shifts in `COLR` v1 color line retrieval
    
    * src/sfnt/ttcolr.c (tt_face_get_colorline_stops): Disambiguate shift
    behavior by using multiplication using macros from ftcalc.h.
    
    Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50573
    

1 changed file:

Changes:

  • src/sfnt/ttcolr.c
    ... ... @@ -1575,7 +1575,7 @@
    1575 1575
         /* Iterator points at first `ColorStop` of `ColorLine`. */
    
    1576 1576
         p = iterator->p;
    
    1577 1577
     
    
    1578
    -    color_stop->stop_offset = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;
    
    1578
    +    color_stop->stop_offset = F2DOT14_TO_FIXED( FT_NEXT_SHORT( p ) );
    
    1579 1579
     
    
    1580 1580
         color_stop->color.palette_index = FT_NEXT_USHORT( p );
    
    1581 1581
     
    
    ... ... @@ -1600,7 +1600,7 @@
    1600 1600
                                                  item_deltas ) )
    
    1601 1601
               return 0;
    
    1602 1602
     
    
    1603
    -        color_stop->stop_offset += (FT_Fixed)item_deltas[0] << 2;
    
    1603
    +        color_stop->stop_offset += F2DOT14_TO_FIXED( item_deltas[0] );
    
    1604 1604
             color_stop->color.alpha += item_deltas[1];
    
    1605 1605
           }
    
    1606 1606
     #else
    


  • reply via email to

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