Skip to content

Commit

Permalink
Add bitmap flushing to gdip_bitmap_clone to fix possible inconsistenc…
Browse files Browse the repository at this point in the history
…ies for drawing flipped images (#604)

There were few usages of `gdip_bitmap_clone` with missing flush calls. Unfortunately there is zero code coverage for these paths. The chances of actually turning this into visible bug are thin. One would have to create an ARGB32 bitmap, draw into it and then try to paint it flipped into another bitmap. Adding the flush call down the stack is a safety precaution that should prevent any incorrect usage.
  • Loading branch information
filipnavara authored and akoeplinger committed Oct 3, 2019
1 parent 9158541 commit c98de97
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bitmap.c
Expand Up @@ -639,6 +639,8 @@ gdip_bitmap_clone (GpBitmap *bitmap, GpBitmap **clonedbitmap)
return OutOfMemory;
}

gdip_bitmap_flush_surface (bitmap);

/* Copy simple types */
result->type = bitmap->type;
result->image_format = bitmap->image_format;
Expand Down

0 comments on commit c98de97

Please sign in to comment.