IWICBitmapDecoder *decoder = NULL;
IStream *stream;
GUID format;
+ LONG refcount;
hmem = GlobalAlloc(0, image_size);
data = GlobalLock(hmem);
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, &format);
ok(hr == S_OK, "GetContainerFormat error %#x\n", hr);
ok(IsEqualGUID(&format, &GUID_ContainerFormatPng),
"wrong container format %s\n", wine_dbgstr_guid(&format));
- IStream_Release(stream);
+ refcount = IStream_Release(stream);
+ ok(refcount > 0, "expected stream refcount > 0\n");
return decoder;
}
decoder = create_decoder(png_no_color_profile, sizeof(png_no_color_profile));
ok(decoder != 0, "Failed to load PNG image data\n");
+ if (!decoder) return;
/* global color context */
hr = IWICBitmapDecoder_GetColorContexts(decoder, 0, NULL, NULL);
decoder = create_decoder(png_color_profile, sizeof(png_color_profile));
ok(decoder != 0, "Failed to load PNG image data\n");
+ if (!decoder) return;
/* global color context */
count = 0xdeadbeef;
decoder = create_decoder(png_PLTE_tRNS, sizeof(png_PLTE_tRNS));
ok(decoder != 0, "Failed to load PNG image data\n");
+ if (!decoder) return;
hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
ok(hr == S_OK, "GetFrame error %#x\n", hr);