wined3d: Release resources on error in wined3d_cs_exec_blt_sub_resource.

Sebastian Lackner sebastian at fds-team.de
Wed Apr 19 11:55:17 CDT 2017


Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
---
 dlls/wined3d/cs.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 43352eb7cb..5ea7650d94 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -1934,14 +1934,14 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
         {
             FIXME("Flags %#x not implemented for %s resources.\n",
                     op->flags, debug_d3dresourcetype(op->dst_resource->type));
-            return;
+            goto error;
         }
 
         if (op->src_resource->format != op->dst_resource->format)
         {
             FIXME("Format conversion not implemented for %s resources.\n",
                     debug_d3dresourcetype(op->dst_resource->type));
-            return;
+            goto error;
         }
 
         update_w = op->dst_box.right - op->dst_box.left;
@@ -1953,14 +1953,14 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
         {
             FIXME("Stretching not implemented for %s resources.\n",
                     debug_d3dresourcetype(op->dst_resource->type));
-            return;
+            goto error;
         }
 
         if (op->src_box.left || op->src_box.top || op->src_box.front)
         {
             FIXME("Source box %s not supported for %s resources.\n",
                     debug_box(&op->src_box), debug_d3dresourcetype(op->dst_resource->type));
-            return;
+            goto error;
         }
 
         dst_texture = texture_from_resource(op->dst_resource);
@@ -1974,7 +1974,7 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
             ERR("Failed to load source sub-resource into %s.\n",
                     wined3d_debug_location(src_texture->resource.map_binding));
             context_release(context);
-            return;
+            goto error;
         }
 
         level = op->dst_sub_resource_idx % dst_texture->level_count;
@@ -1989,7 +1989,7 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
         {
             ERR("Failed to load destination sub-resource.\n");
             context_release(context);
-            return;
+            goto error;
         }
 
         wined3d_texture_get_memory(src_texture, op->src_sub_resource_idx, &addr, src_texture->resource.map_binding);
@@ -2009,6 +2009,7 @@ static void wined3d_cs_exec_blt_sub_resource(struct wined3d_cs *cs, const void *
         FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(op->dst_resource->type));
     }
 
+error:
     if (op->src_resource)
         wined3d_resource_release(op->src_resource);
     wined3d_resource_release(op->dst_resource);
-- 
2.12.2



More information about the wine-patches mailing list