Added patch to fix wglDescribePixelFormat when NULL is passed as pixel format descriptor.

This commit is contained in:
Sebastian Lackner
2014-11-08 11:35:23 +01:00
parent 03554ec52b
commit e5b7f0c052
5 changed files with 53 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
From 69bb805398645531fbc224319ab99dab29129c68 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
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

View File

@@ -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