freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] * src/smooth/ftgrays.c (gray_convert_gl


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] * src/smooth/ftgrays.c (gray_convert_glyph): Clear stack pointers.
Date: Sun, 13 Oct 2024 16:18:50 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

  • 089ccb1b
    by Alexei Podtelezhnikov (Алексей Подтележников) at 2024-10-13T12:14:43-04:00
    * src/smooth/ftgrays.c (gray_convert_glyph): Clear stack pointers.
    
    Fixes a dangling pointer warning, see #1299.
    

1 changed file:

Changes:

  • src/smooth/ftgrays.c
    ... ... @@ -1873,6 +1873,7 @@ typedef ptrdiff_t FT_PtrDist;
    1873 1873
         TCoord*  band;
    
    1874 1874
     
    
    1875 1875
         int  continued = 0;
    
    1876
    +    int  error     = Smooth_Err_Ok;
    
    1876 1877
     
    
    1877 1878
     
    
    1878 1879
         /* Initialize the null cell at the end of the poll. */
    
    ... ... @@ -1907,7 +1908,6 @@ typedef ptrdiff_t FT_PtrDist;
    1907 1908
           do
    
    1908 1909
           {
    
    1909 1910
             TCoord  i;
    
    1910
    -        int     error;
    
    1911 1911
     
    
    1912 1912
     
    
    1913 1913
             ras.min_ex = band[1];
    
    ... ... @@ -1936,7 +1936,7 @@ typedef ptrdiff_t FT_PtrDist;
    1936 1936
               continue;
    
    1937 1937
             }
    
    1938 1938
             else if ( error != Smooth_Err_Raster_Overflow )
    
    1939
    -          return error;
    
    1939
    +          goto Exit;
    
    1940 1940
     
    
    1941 1941
             /* render pool overflow; we will reduce the render band by half */
    
    1942 1942
             i = ( band[0] - band[1] ) >> 1;
    
    ... ... @@ -1945,7 +1945,8 @@ typedef ptrdiff_t FT_PtrDist;
    1945 1945
             if ( i == 0 )
    
    1946 1946
             {
    
    1947 1947
               FT_TRACE7(( "gray_convert_glyph: rotten glyph\n" ));
    
    1948
    -          return FT_THROW( Raster_Overflow );
    
    1948
    +          error = FT_THROW( Raster_Overflow );
    
    1949
    +          goto Exit;
    
    1949 1950
             }
    
    1950 1951
     
    
    1951 1952
             band++;
    
    ... ... @@ -1954,7 +1955,11 @@ typedef ptrdiff_t FT_PtrDist;
    1954 1955
           } while ( band >= bands );
    
    1955 1956
         }
    
    1956 1957
     
    
    1957
    -    return Smooth_Err_Ok;
    
    1958
    +  Exit:
    
    1959
    +    ras.cell   = ras.cell_free = ras.cell_null = NULL;
    
    1960
    +    ras.ycells = NULL;
    
    1961
    +
    
    1962
    +    return error;
    
    1958 1963
       }
    
    1959 1964
     
    
    1960 1965
     
    


  • reply via email to

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