freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype-demos][master] * graph/gblblit.c (gblender_blit_


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype-demos][master] * graph/gblblit.c (gblender_blit_init): Fix for negative pitch.
Date: Fri, 16 Sep 2022 03:42:45 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType Demo Programs

Commits:

  • a005039b
    by Alexei Podtelezhnikov at 2022-09-15T23:39:08-04:00
    * graph/gblblit.c (gblender_blit_init): Fix for negative pitch.
    
    Reported by Anurag Thakur.
    

1 changed file:

Changes:

  • graph/gblblit.c
    ... ... @@ -329,6 +329,11 @@ gblender_blit_init( GBlenderBlit blit,
    329 329
         return -2;
    
    330 330
       }
    
    331 331
     
    
    332
    +  if ( src_pitch < 0 )
    
    333
    +    src_buffer -= src_pitch * ( src_height - 1 );
    
    334
    +  if ( dst_pitch < 0 )
    
    335
    +    dst_buffer -= dst_pitch * ( dst_height - 1 );
    
    336
    +
    
    332 337
       if ( dst_x < 0 )
    
    333 338
       {
    
    334 339
         src_width += dst_x;
    
    ... ... @@ -360,14 +365,10 @@ gblender_blit_init( GBlenderBlit blit,
    360 365
       blit->height    = src_height;
    
    361 366
     
    
    362 367
       blit->src_pitch = src_pitch;
    
    363
    -  if ( src_pitch < 0 )
    
    364
    -    src_y -= src_height - 1;
    
    365 368
       blit->src_line  = src_buffer + src_pitch * src_y;
    
    366 369
       blit->src_x     = src_x;
    
    367 370
     
    
    368 371
       blit->dst_pitch = dst_pitch;
    
    369
    -  if ( dst_pitch < 0 )
    
    370
    -    dst_y -= dst_height - 1;
    
    371 372
       blit->dst_line  = dst_buffer + dst_pitch * dst_y;
    
    372 373
       blit->dst_x     = dst_x;
    
    373 374
     
    


  • reply via email to

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