You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Added patch to avoid crashing when broken app tries to release surface although refcount is zero.
This commit is contained in:
@@ -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