From 5f1dedc6c4f216364ee759978517a6f923c972e0 Mon Sep 17 00:00:00 2001 From: Timotheus Pokorra Date: Tue, 4 Aug 2020 20:35:54 +0200 Subject: [PATCH] add patch for drawing images --- libgdiplus-6.0.4-bitmap_flush.patch | 24 ++++++++++++++++++++++++ libgdiplus.spec | 7 ++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 libgdiplus-6.0.4-bitmap_flush.patch diff --git a/libgdiplus-6.0.4-bitmap_flush.patch b/libgdiplus-6.0.4-bitmap_flush.patch new file mode 100644 index 0000000..1072bab --- /dev/null +++ b/libgdiplus-6.0.4-bitmap_flush.patch @@ -0,0 +1,24 @@ +From c98de971e5f453f50f898494b7791feb02302f62 Mon Sep 17 00:00:00 2001 +From: Filip Navara +Date: Thu, 3 Oct 2019 13:33:50 +0200 +Subject: [PATCH] Add bitmap flushing to gdip_bitmap_clone to fix possible + inconsistencies 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. +--- + src/bitmap.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/bitmap.c b/src/bitmap.c +index 12485428..d52b15a8 100644 +--- a/src/bitmap.c ++++ b/src/bitmap.c +@@ -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; diff --git a/libgdiplus.spec b/libgdiplus.spec index d8a3692..5b2cda7 100644 --- a/libgdiplus.spec +++ b/libgdiplus.spec @@ -3,11 +3,12 @@ Name: libgdiplus Version: 6.0.4 -Release: 3%{?dist} +Release: 4%{?dist} Summary: An Open Source implementation of the GDI+ API License: MIT URL: http://www.mono-project.com/Main_Page Source0: http://download.mono-project.com/sources/%{name}/%{name}-%{version}.tar.gz +Patch1: libgdiplus-6.0.4-bitmap_flush.patch BuildRequires: gcc BuildRequires: freetype-devel glib2-devel libjpeg-devel libtiff-devel BuildRequires: libpng-devel fontconfig-devel @@ -27,6 +28,7 @@ Development files for libgdiplus %prep %setup -q +%patch1 -p1 CFLAGS="$RPM_OPT_FLAGS -Wl,-z,lazy" CXXFLAGS="$RPM_OPT_FLAGS -Wl,-z,lazy" @@ -55,6 +57,9 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';' %{_libdir}/lib*.so %changelog +* Tue Aug 04 2020 Timotheus Pokorra - 6.0.4-4 +- add patch for drawing images + * Tue Jul 28 2020 Fedora Release Engineering - 6.0.4-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild