Commit b4035288 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

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

parent 6f38a744
......@@ -225,7 +225,7 @@ static HRESULT WINAPI BitmapScaler_CopyPixels(IWICBitmapScaler *iface,
if (!This->source)
{
hr = WINCODEC_ERR_WRONGSTATE;
hr = WINCODEC_ERR_NOTINITIALIZED;
goto end;
}
......
......@@ -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);
......
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