wincodecs: Fix failure paths in scaler's GetSize().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2018-11-09 14:26:44 +03:00 committed by Alexandre Julliard
parent 85a216648c
commit 9556419d7c
2 changed files with 3 additions and 8 deletions

View File

@ -108,12 +108,12 @@ static HRESULT WINAPI BitmapScaler_GetSize(IWICBitmapScaler *iface,
BitmapScaler *This = impl_from_IWICBitmapScaler(iface);
TRACE("(%p,%p,%p)\n", iface, puiWidth, puiHeight);
if (!This->source)
return WINCODEC_ERR_NOTINITIALIZED;
if (!puiWidth || !puiHeight)
return E_INVALIDARG;
if (!This->source)
return WINCODEC_ERR_WRONGSTATE;
*puiWidth = This->width;
*puiHeight = This->height;

View File

@ -1107,17 +1107,14 @@ static void test_bitmap_scaler(void)
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
hr = IWICBitmapScaler_GetSize(scaler, NULL, &height);
todo_wine
ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
hr = IWICBitmapScaler_GetSize(scaler, &width, NULL);
todo_wine
ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
width = 123;
height = 321;
hr = IWICBitmapScaler_GetSize(scaler, &width, &height);
todo_wine
ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
ok(width == 123, "Unexpected width %u.\n", width);
ok(height == 321, "Unexpected height %u.\n", height);
@ -1127,7 +1124,6 @@ todo_wine
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
hr = IWICBitmapScaler_GetSize(scaler, &width, &height);
todo_wine
ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
hr = IWICBitmapScaler_Initialize(scaler, (IWICBitmapSource *)bitmap, 0, 2,
@ -1135,7 +1131,6 @@ todo_wine
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
hr = IWICBitmapScaler_GetSize(scaler, &width, &height);
todo_wine
ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
hr = IWICBitmapScaler_Initialize(scaler, NULL, 8, 4,