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

