Aric Stewart : windowscodecs/tests: Handle failure to create TIFF decoder.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Oct 1 10:57:01 CDT 2015


Module: wine
Branch: master
Commit: af6413aaeb1d67db9ec77545ccef6d402756cf02
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=af6413aaeb1d67db9ec77545ccef6d402756cf02

Author: Aric Stewart <aric at codeweavers.com>
Date:   Wed Sep 30 10:54:19 2015 -0500

windowscodecs/tests: Handle failure to create TIFF decoder.

Signed-off-by: Aric Stewart <aric at codeweavers.com>

---

 dlls/windowscodecs/tests/tiffformat.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/windowscodecs/tests/tiffformat.c b/dlls/windowscodecs/tests/tiffformat.c
index d07caa3..e4a4b66 100644
--- a/dlls/windowscodecs/tests/tiffformat.c
+++ b/dlls/windowscodecs/tests/tiffformat.c
@@ -170,6 +170,7 @@ static IWICBitmapDecoder *create_decoder(const void *image_data, UINT image_size
 
     hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, 0, &decoder);
     ok(hr == S_OK, "CreateDecoderFromStream error %#x\n", hr);
+    if (FAILED(hr)) return NULL;
 
     hr = IWICBitmapDecoder_GetContainerFormat(decoder, &guid);
     ok(hr == S_OK, "GetContainerFormat error %#x\n", hr);
@@ -190,6 +191,7 @@ static void test_tiff_palette(void)
 
     decoder = create_decoder(&tiff_1bpp_data, sizeof(tiff_1bpp_data));
     ok(decoder != 0, "Failed to load TIFF image data\n");
+    if (!decoder) return;
 
     hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
     ok(hr == S_OK, "GetFrame error %#x\n", hr);
@@ -231,6 +233,7 @@ static void test_QueryCapability(void)
 
     hr = IWICImagingFactory_CreateDecoder(factory, &GUID_ContainerFormatTiff, NULL, &decoder);
     ok(hr == S_OK, "CreateDecoder error %#x\n", hr);
+    if (FAILED(hr)) return;
 
     frame_count = 0xdeadbeef;
     hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
@@ -322,6 +325,7 @@ static void test_tiff_8bpp_alpha(void)
 
     decoder = create_decoder(&tiff_8bpp_alpha, sizeof(tiff_8bpp_alpha));
     ok(decoder != 0, "Failed to load TIFF image data\n");
+    if (!decoder) return;
 
     hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
     ok(hr == S_OK, "GetFrameCount error %#x\n", hr);




More information about the wine-cvs mailing list