Commit 0d263f9f authored by Ziqing Hui's avatar Ziqing Hui Committed by Alexandre Julliard

windowscodecs: Check NULL parameters for DdsFrameDecode_GetSize().

parent a1222a35
......@@ -301,6 +301,8 @@ static HRESULT WINAPI DdsFrameDecode_GetSize(IWICBitmapFrameDecode *iface,
{
DdsFrameDecode *This = impl_from_IWICBitmapFrameDecode(iface);
if (!puiWidth || !puiHeight) return E_INVALIDARG;
*puiWidth = This->width;
*puiHeight = This->height;
......
......@@ -382,6 +382,12 @@ static void test_dds_decoder_frame_size(IWICBitmapDecoder *decoder, IWICBitmapFr
ok (hr == S_OK, "%d: GetParameters failed, hr=%x\n", i, hr);
if (hr != S_OK) goto end;
hr = IWICBitmapFrameDecode_GetSize(frame_decode, NULL, NULL);
ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr);
hr = IWICBitmapFrameDecode_GetSize(frame_decode, NULL, &height);
ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr);
hr = IWICBitmapFrameDecode_GetSize(frame_decode, &width, NULL);
ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr);
hr = IWICBitmapFrameDecode_GetSize(frame_decode, &width, &height);
ok (hr == S_OK, "%d: GetSize failed for frame %d, hr=%x\n", i, frame_index, hr);
if (hr != S_OK) goto end;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment