Commit 3f082762 authored by Ziqing Hui's avatar Ziqing Hui Committed by Alexandre Julliard

windowscodecs: More complete implementation of DdsFrameDecode_CopyPixels().

parent 1b4318b1
...@@ -607,20 +607,19 @@ static HRESULT WINAPI DdsFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface, ...@@ -607,20 +607,19 @@ static HRESULT WINAPI DdsFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface,
if (!prc) { if (!prc) {
if (cbStride < frame_stride) return E_INVALIDARG; if (cbStride < frame_stride) return E_INVALIDARG;
if (cbBufferSize < frame_size) return WINCODEC_ERR_INSUFFICIENTBUFFER; if (cbBufferSize < frame_size) return WINCODEC_ERR_INSUFFICIENTBUFFER;
return S_OK; } else {
} x = prc->X;
y = prc->Y;
x = prc->X; width = prc->Width;
y = prc->Y; height = prc->Height;
width = prc->Width; if (x < 0 || y < 0 || width <= 0 || height <= 0 ||
height = prc->Height; x + width > This->info.width ||
if (x < 0 || y < 0 || width <= 0 || height <= 0 || y + height > This->info.height) {
x + width > This->info.width || return E_INVALIDARG;
y + height > This->info.height) { }
return E_INVALIDARG; if (cbStride < width * bpp / 8) return E_INVALIDARG;
if (cbBufferSize < cbStride * height) return WINCODEC_ERR_INSUFFICIENTBUFFER;
} }
if (cbStride < width * bpp / 8) return E_INVALIDARG;
if (cbBufferSize < cbStride * height) return WINCODEC_ERR_INSUFFICIENTBUFFER;
EnterCriticalSection(&This->lock); EnterCriticalSection(&This->lock);
...@@ -632,6 +631,9 @@ static HRESULT WINAPI DdsFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface, ...@@ -632,6 +631,9 @@ static HRESULT WINAPI DdsFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface,
} }
} }
hr = copy_pixels(bpp, This->pixel_data, This->info.width, This->info.height, frame_stride,
prc, cbStride, cbBufferSize, pbBuffer);
end: end:
LeaveCriticalSection(&This->lock); LeaveCriticalSection(&This->lock);
......
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