summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungha Yang <seungha@centricular.com>2023-05-27 00:01:21 +0900
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2023-05-27 06:52:19 +0000
commitff405f714727b68d2b8819312d5b210c795065d5 (patch)
treeea7d79e5cd252af69e1365ccadcb22b3d1f63fe8
parent155ea21d2b8894957c90a685e75893fd43eb8b78 (diff)
pango: Fix crash on Windows 32bit build
See https://gitlab.gnome.org/GNOME/pango/-/merge_requests/694 Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2604 Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1186>
-rw-r--r--recipes/pango.recipe3
-rw-r--r--recipes/pango/0001-win32-Fix-32bit-build-crash-on-DeleteDC.patch36
2 files changed, 38 insertions, 1 deletions
diff --git a/recipes/pango.recipe b/recipes/pango.recipe
index 05198261..4a4e4702 100644
--- a/recipes/pango.recipe
+++ b/recipes/pango.recipe
@@ -22,7 +22,8 @@ class Recipe(recipe.Recipe):
name + '/0001-pangowin32-fontmap-read-windows-fallbacks-from-regis.patch',
# https://gitlab.gnome.org/GNOME/pango/-/merge_requests/34
name + '/0002-win32-Use-GPrivate-managed-display-device-context.patch',
- # https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/574
+ # https://gitlab.gnome.org/GNOME/pango/-/merge_requests/694
+ name + '/0001-win32-Fix-32bit-build-crash-on-DeleteDC.patch',
]
files_libs = ['libpangocairo-1.0', 'libpango-1.0', 'libpangoft2-1.0']
diff --git a/recipes/pango/0001-win32-Fix-32bit-build-crash-on-DeleteDC.patch b/recipes/pango/0001-win32-Fix-32bit-build-crash-on-DeleteDC.patch
new file mode 100644
index 00000000..b489a968
--- /dev/null
+++ b/recipes/pango/0001-win32-Fix-32bit-build-crash-on-DeleteDC.patch
@@ -0,0 +1,36 @@
+From 564de11dab6422d980fbb5b83e2b452a21708032 Mon Sep 17 00:00:00 2001
+From: Seungha Yang <seungha@centricular.com>
+Date: Fri, 26 May 2023 20:23:47 +0900
+Subject: [PATCH] win32: Fix 32bit build crash on DeleteDC()
+
+Calling convention mismatch will result in crash or so
+
+Fixes: https://gitlab.gnome.org/GNOME/pango/-/issues/749
+---
+ pango/pangowin32.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/pango/pangowin32.c b/pango/pangowin32.c
+index eed92dde..fbedaa74 100644
+--- a/pango/pangowin32.c
++++ b/pango/pangowin32.c
+@@ -125,7 +125,15 @@ _pango_win32_font_init (PangoWin32Font *win32font)
+ win32font->glyph_info = g_hash_table_new_full (NULL, NULL, NULL, g_free);
+ }
+
+-static GPrivate display_dc_key = G_PRIVATE_INIT ((GDestroyNotify) DeleteDC);
++static void
++_delete_dc (HDC dc)
++{
++ /* Don't pass DeleteDC func pointer to the GDestroyNotify.
++ * 32bit build requires matching calling convention (__cdecl vs __stdcall) */
++ DeleteDC (dc);
++}
++
++static GPrivate display_dc_key = G_PRIVATE_INIT ((GDestroyNotify) _delete_dc);
+
+ HDC
+ _pango_win32_get_display_dc (void)
+--
+2.35.3.windows.1
+