You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Added patch to avoid crashing when broken app tries to release surface although refcount is zero.
This commit is contained in:
@@ -27,6 +27,7 @@ PATCHLIST := \
|
||||
comctl32-LoadIconMetric.ok \
|
||||
configure-Absolute_RPATH.ok \
|
||||
configure-Detect_Gnutls.ok \
|
||||
d3d9-Surface_Refcount.ok \
|
||||
d3dx9_36-DXTn.ok \
|
||||
d3dx9_36-Filter_Warnings.ok \
|
||||
d3dx9_36-GetShaderSemantics.ok \
|
||||
@@ -326,6 +327,24 @@ configure-Detect_Gnutls.ok:
|
||||
echo '+ { "configure-Detect_Gnutls", "Sebastian Lackner", "Fix detection of gnutls on Ubuntu 14.10. [rev 3]" },'; \
|
||||
) > configure-Detect_Gnutls.ok
|
||||
|
||||
# Patchset d3d9-Surface_Refcount
|
||||
# |
|
||||
# | Included patches:
|
||||
# | * Don't decrease surface refcount when its already zero. [by Henri Verbeet]
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#18477] Avoid crashing when broken app tries to release surface although refcount is zero
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/d3d9/surface.c
|
||||
# |
|
||||
.INTERMEDIATE: d3d9-Surface_Refcount.ok
|
||||
d3d9-Surface_Refcount.ok:
|
||||
$(call APPLY_FILE,d3d9-Surface_Refcount/0001-d3d9-Don-t-decrease-surface-refcount-when-its-alread.patch)
|
||||
@( \
|
||||
echo '+ { "d3d9-Surface_Refcount", "Henri Verbeet", "Don'\''t decrease surface refcount when its already zero." },'; \
|
||||
) > d3d9-Surface_Refcount.ok
|
||||
|
||||
# Patchset d3dx9_36-DXTn
|
||||
# |
|
||||
# | Included patches:
|
||||
|
@@ -0,0 +1,29 @@
|
||||
From ee74f6d71079cda75ba94841e4369c519489c879 Mon Sep 17 00:00:00 2001
|
||||
From: Henri Verbeet <hverbeet@codeweavers.com>
|
||||
Date: Tue, 11 Nov 2014 22:32:00 +0100
|
||||
Subject: d3d9: Don't decrease surface refcount when its already zero.
|
||||
|
||||
---
|
||||
dlls/d3d9/surface.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c
|
||||
index e5eb11f..2aab5f3 100644
|
||||
--- a/dlls/d3d9/surface.c
|
||||
+++ b/dlls/d3d9/surface.c
|
||||
@@ -91,6 +91,12 @@ static ULONG WINAPI d3d9_surface_Release(IDirect3DSurface9 *iface)
|
||||
return IDirect3DBaseTexture9_Release(&surface->texture->IDirect3DBaseTexture9_iface);
|
||||
}
|
||||
|
||||
+ if (!surface->resource.refcount)
|
||||
+ {
|
||||
+ ERR("Surface doesn't have any references.\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
refcount = InterlockedDecrement(&surface->resource.refcount);
|
||||
TRACE("%p decreasing refcount to %u.\n", iface, refcount);
|
||||
|
||||
--
|
||||
2.1.3
|
||||
|
4
patches/d3d9-Surface_Refcount/definition
Normal file
4
patches/d3d9-Surface_Refcount/definition
Normal file
@@ -0,0 +1,4 @@
|
||||
Author: Henri Verbeet
|
||||
Subject: Don't decrease surface refcount when its already zero.
|
||||
Revision: 1
|
||||
Fixes: [18477] Avoid crashing when broken app tries to release surface although refcount is zero
|
Reference in New Issue
Block a user