From 4cecbaa54d71742c6705af4be7ea6b07485489b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Tue, 8 Jul 2014 15:58:43 +0200 Subject: [PATCH] wined3d: Ignore set_priority calls on non-managed resources. --- dlls/wined3d/resource.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 3a54dd8a3f..caec580f9c 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -163,7 +163,15 @@ void resource_unload(struct wined3d_resource *resource) DWORD resource_set_priority(struct wined3d_resource *resource, DWORD priority) { - DWORD prev = resource->priority; + DWORD prev; + + if (resource->pool != WINED3D_POOL_MANAGED) + { + WARN("Called on non-managed resource %p, ignoring.\n", resource); + return 0; + } + + prev = resource->priority; resource->priority = priority; TRACE("resource %p, new priority %u, returning old priority %u.\n", resource, priority, prev); return prev;