windowscodecs: Correct IWICBitmapScaler::CopyPixels() error for not initialized case.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Vincent Povirk <vincent@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2019-05-16 10:53:00 +08:00 committed by Alexandre Julliard
parent 6f38a7443c
commit b4035288b7
2 changed files with 5 additions and 1 deletions

View File

@ -225,7 +225,7 @@ static HRESULT WINAPI BitmapScaler_CopyPixels(IWICBitmapScaler *iface,
if (!This->source)
{
hr = WINCODEC_ERR_WRONGSTATE;
hr = WINCODEC_ERR_NOTINITIALIZED;
goto end;
}

View File

@ -1163,6 +1163,7 @@ static void test_bitmap_scaler(void)
double res_x, res_y;
IWICBitmap *bitmap;
UINT width, height;
BYTE buf[16];
HRESULT hr;
hr = IWICImagingFactory_CreateBitmap(factory, 4, 2, &GUID_WICPixelFormat24bppBGR, WICBitmapCacheOnLoad, &bitmap);
@ -1240,6 +1241,9 @@ static void test_bitmap_scaler(void)
hr = IWICBitmapScaler_GetSize(scaler, &width, &height);
ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
hr = IWICBitmapScaler_CopyPixels(scaler, NULL, 1, sizeof(buf), buf);
ok(hr == WINCODEC_ERR_NOTINITIALIZED, "Unexpected hr %#x.\n", hr);
hr = IWICBitmapScaler_Initialize(scaler, (IWICBitmapSource *)bitmap, 0, 2,
WICBitmapInterpolationModeNearestNeighbor);
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);