From e5b7f0c052a287e4537e6d0d12775ed6348eb3e5 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 8 Nov 2014 11:35:23 +0100 Subject: [PATCH] Added patch to fix wglDescribePixelFormat when NULL is passed as pixel format descriptor. --- README.md | 3 ++- debian/changelog | 1 + patches/Makefile | 19 +++++++++++++ ...imum-number-of-pixel-formats-when-NU.patch | 27 +++++++++++++++++++ patches/gdi32-MaxPixelFormats/definition | 4 +++ 5 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 patches/gdi32-MaxPixelFormats/0001-gdi32-Return-maximum-number-of-pixel-formats-when-NU.patch create mode 100644 patches/gdi32-MaxPixelFormats/definition diff --git a/README.md b/README.md index ee26465f..aee08901 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Wine. All those differences are also documented on the Included bug fixes and improvements =================================== -**Bugfixes and features included in the next upcoming release [10]:** +**Bugfixes and features included in the next upcoming release [11]:** * Add stub for NtSetLdtEntries/ZwSetLdtEntries ([Wine Bug #26268](https://bugs.winehq.org/show_bug.cgi?id=26268)) * Add stubs for vectored continue handler ([Wine Bug #30572](https://bugs.winehq.org/show_bug.cgi?id=30572)) @@ -51,6 +51,7 @@ Included bug fixes and improvements * Fix texture corruption in CSI: Fatal Conspiracy ([Wine Bug #33768](https://bugs.winehq.org/show_bug.cgi?id=33768)) * Return correct values for GetThreadTimes function ([Wine Bug #20230](https://bugs.winehq.org/show_bug.cgi?id=20230)) * vSphere needs IoCsqInitialize ([Wine Bug #36777](https://bugs.winehq.org/show_bug.cgi?id=36777)) +* wglDescribePixelFormat should return max index for NULL descriptor ([Wine Bug #6176](https://bugs.winehq.org/show_bug.cgi?id=6176)) **Bugs fixed in Wine Staging 1.7.30 [90]:** diff --git a/debian/changelog b/debian/changelog index 0deea3c7..b7edbabd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,7 @@ wine-compholio (1.7.31) UNRELEASED; urgency=low * Added patch to align texture dimensions to block size for compressed textures. * Added patch with stub for IoCsqInitialize. * Added patch with stubs for vectored continue handler functions. + * Added patch to fix wglDescribePixelFormat when NULL is passed as pixel format descriptor. * Removed patch for iphlpapi stub functions (accepted upstream). * Removed patches for FindFirstFileExW (accepted upstream). * Removed patches for TLB dependencies lookup in resources (accepted upstream). diff --git a/patches/Makefile b/patches/Makefile index 27962108..bc7a29c0 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -35,6 +35,7 @@ PATCHLIST := \ dbghelp-KdHelp.ok \ dsound-Fast_Mixer.ok \ fonts-Missing_Fonts.ok \ + gdi32-MaxPixelFormats.ok \ gdi32-MultiMonitor.ok \ gdiplus-GdipCreateRegionRgnData.ok \ imagehlp-BindImageEx.ok \ @@ -469,6 +470,24 @@ fonts-Missing_Fonts.ok: echo '+ { "fonts-Missing_Fonts", "Torsten Kurbad / Erich E. Hoover", "Implement missing fonts expected by Silverlight. [rev 2]" },'; \ ) > fonts-Missing_Fonts.ok +# Patchset gdi32-MaxPixelFormats +# | +# | Included patches: +# | * Return maximum number of pixel formats when NULL pointer is passed to wglDescribePixelFormat. [by Sebastian Lackner] +# | +# | This patchset fixes the following Wine bugs: +# | * [#6176] wglDescribePixelFormat should return max index for NULL descriptor +# | +# | Modified files: +# | * dlls/gdi32/dibdrv/opengl.c +# | +.INTERMEDIATE: gdi32-MaxPixelFormats.ok +gdi32-MaxPixelFormats.ok: + $(call APPLY_FILE,gdi32-MaxPixelFormats/0001-gdi32-Return-maximum-number-of-pixel-formats-when-NU.patch) + @( \ + echo '+ { "gdi32-MaxPixelFormats", "Sebastian Lackner", "Return maximum number of pixel formats when NULL pointer is passed to wglDescribePixelFormat." },'; \ + ) > gdi32-MaxPixelFormats.ok + # Patchset gdi32-MultiMonitor # | # | Included patches: diff --git a/patches/gdi32-MaxPixelFormats/0001-gdi32-Return-maximum-number-of-pixel-formats-when-NU.patch b/patches/gdi32-MaxPixelFormats/0001-gdi32-Return-maximum-number-of-pixel-formats-when-NU.patch new file mode 100644 index 00000000..3083b7fc --- /dev/null +++ b/patches/gdi32-MaxPixelFormats/0001-gdi32-Return-maximum-number-of-pixel-formats-when-NU.patch @@ -0,0 +1,27 @@ +From 69bb805398645531fbc224319ab99dab29129c68 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sat, 8 Nov 2014 11:32:11 +0100 +Subject: gdi32: Return maximum number of pixel formats when NULL pointer is + passed to wglDescribePixelFormat. + +--- + dlls/gdi32/dibdrv/opengl.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/dlls/gdi32/dibdrv/opengl.c b/dlls/gdi32/dibdrv/opengl.c +index 28a03f4..edbd2e9 100644 +--- a/dlls/gdi32/dibdrv/opengl.c ++++ b/dlls/gdi32/dibdrv/opengl.c +@@ -149,7 +149,8 @@ static int dibdrv_wglDescribePixelFormat( HDC hdc, int fmt, UINT size, PIXELFORM + { + int ret = sizeof(pixel_formats) / sizeof(pixel_formats[0]); + +- if (fmt <= 0 || fmt > ret) return ret; ++ if (!descr) return ret; ++ if (fmt <= 0 || fmt > ret) return ret; /* FIXME: should this be 0? */ + if (size < sizeof(*descr)) return 0; + + memset( descr, 0, sizeof(*descr) ); +-- +2.1.3 + diff --git a/patches/gdi32-MaxPixelFormats/definition b/patches/gdi32-MaxPixelFormats/definition new file mode 100644 index 00000000..2620a150 --- /dev/null +++ b/patches/gdi32-MaxPixelFormats/definition @@ -0,0 +1,4 @@ +Author: Sebastian Lackner +Subject: Return maximum number of pixel formats when NULL pointer is passed to wglDescribePixelFormat. +Revision: 1 +Fixes: [6176] wglDescribePixelFormat should return max index for NULL descriptor