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-26 22:54:07 +0000
commit57303457bfb360e854d11581e807dba90a5271aa (patch)
tree8f8c8c21d70b5d776565c70753c0e04acd63d3ea
parente3fe99760be03781e6180d08f4771df092468bd7 (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/1184>
-rw-r--r--recipes/pango.recipe2
-rw-r--r--recipes/pango/0001-win32-Fix-32bit-build-crash-on-DeleteDC.patch36
2 files changed, 38 insertions, 0 deletions
diff --git a/recipes/pango.recipe b/recipes/pango.recipe
index d2702da4..abc9b5e0 100644
--- a/recipes/pango.recipe
+++ b/recipes/pango.recipe
@@ -16,6 +16,8 @@ class Recipe(recipe.Recipe):
'pango/0001-meson-fix-freetype-lookup-with-MSVC-using-pkg-config.patch',
# TODO: propose upstream for merging
'pango/0001-pango-layout-fix-build-with-Android-s-bionic-libc.patch',
+ # https://gitlab.gnome.org/GNOME/pango/-/merge_requests/694
+ 'pango/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
+