Added patch to avoid crash in d3d9 tests by skipping when texture/surface creation fails.

This commit is contained in:
Sebastian Lackner 2015-03-14 02:35:58 +01:00
parent 70c01d5385
commit 4bfaa67fea
3 changed files with 60 additions and 0 deletions

1
debian/changelog vendored
View File

@ -4,6 +4,7 @@ wine-staging (1.7.39) UNRELEASED; urgency=low
* Added patch with tests for VerQueryValueA (by Mark Jansen).
* Added patch to implement proper locking of keystate and synchronization with desktop thread.
* Added patch to implement better stub function for NtQueryInformationJobObject.
* Added patch to avoid crash in d3d9 tests by skipping when texture/surface creation fails.
* Removed patch to avoid hardcoded values for sizeof(GUID) (accepted upstream).
* Removed patches for SLGetWindowsInformationDWORD (accepted upstream).
-- Sebastian Lackner <sebastian@fds-team.de> Mon, 09 Mar 2015 16:52:35 +0100

View File

@ -0,0 +1,43 @@
From d4c757fd049018cad57ad8d6ef304b9dd2220ae0 Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Fri, 13 Mar 2015 23:42:20 +0100
Subject: d3d9/tests: Avoid crash when surface and texture creation fails.
---
dlls/d3d9/tests/device.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index f1c75e4..46612f5 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -7779,8 +7779,14 @@ static void test_surface_blocks(void)
break;
default:
+ hr = E_FAIL;
break;
}
+ if (FAILED(hr))
+ {
+ skip("Failed to create surface, skipping tests.\n");
+ continue;
+ }
if (formats[i].block_width > 1)
{
@@ -8661,6 +8667,11 @@ static void test_volume_blocks(void)
hr = IDirect3DDevice9_CreateVolumeTexture(device, 24, 8, 8, 1, 0,
formats[i].fmt, D3DPOOL_SCRATCH, &texture, NULL);
ok(SUCCEEDED(hr), "Failed to create volume texture, hr %#x.\n", hr);
+ if (FAILED(hr))
+ {
+ skip("Failed to create texture, skipping tests.\n");
+ continue;
+ }
/* Test lockrect offset */
for (j = 0; j < sizeof(offset_tests) / sizeof(*offset_tests); j++)
--
2.3.2

View File

@ -71,6 +71,7 @@ patch_enable_all ()
enable_comctl32_LoadIconMetric="$1"
enable_configure_Absolute_RPATH="$1"
enable_d3d8_Hotpatch="$1"
enable_d3d9_Skip_Tests="$1"
enable_d3d9_Surface_Refcount="$1"
enable_d3drm_Specfile="$1"
enable_d3dx9_36_AnimationController="$1"
@ -255,6 +256,9 @@ patch_enable ()
d3d8-Hotpatch)
enable_d3d8_Hotpatch="$2"
;;
d3d9-Skip_Tests)
enable_d3d9_Skip_Tests="$2"
;;
d3d9-Surface_Refcount)
enable_d3d9_Surface_Refcount="$2"
;;
@ -1312,6 +1316,18 @@ if test "$enable_d3d8_Hotpatch" -eq 1; then
) >> "$patchlist"
fi
# Patchset d3d9-Skip_Tests
# |
# | Modified files:
# | * dlls/d3d9/tests/device.c
# |
if test "$enable_d3d9_Skip_Tests" -eq 1; then
patch_apply d3d9-Skip_Tests/0001-d3d9-tests-Avoid-crash-when-surface-and-texture-crea.patch
(
echo '+ { "Christian Costa", "d3d9/tests: Avoid crash when surface and texture creation fails.", 1 },';
) >> "$patchlist"
fi
# Patchset d3d9-Surface_Refcount
# |
# | This patchset fixes the following Wine bugs: