Zebediah Figura : quartz/vmr9: Align the source pitch to a multiple of 4.
Alexandre Julliard
julliard at winehq.org
Mon Jun 22 15:55:57 CDT 2020
Module: wine
Branch: master
Commit: d4178020151b9c70affebc31fe354354585dbb9a
URL: https://source.winehq.org/git/wine.git/?a=commit;h=d4178020151b9c70affebc31fe354354585dbb9a
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Fri Jun 19 19:50:13 2020 -0500
quartz/vmr9: Align the source pitch to a multiple of 4.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/quartz/vmr9.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c
index f81d806705..5c2cf33820 100644
--- a/dlls/quartz/vmr9.c
+++ b/dlls/quartz/vmr9.c
@@ -211,8 +211,8 @@ static HRESULT WINAPI VMR9_DoRenderSample(struct strmbase_renderer *iface, IMedi
{
struct quartz_vmr *filter = impl_from_IBaseFilter(&iface->filter.IBaseFilter_iface);
const HANDLE events[2] = {filter->run_event, filter->renderer.flush_event};
+ unsigned int data_size, width, depth, src_pitch;
const BITMAPINFOHEADER *bitmap_header;
- unsigned int data_size, width, depth;
REFERENCE_TIME start_time, end_time;
VMR9PresentationInfo info = {};
D3DLOCKED_RECT locked_rect;
@@ -261,6 +261,7 @@ static HRESULT WINAPI VMR9_DoRenderSample(struct strmbase_renderer *iface, IMedi
width = bitmap_header->biWidth;
height = bitmap_header->biHeight;
depth = bitmap_header->biBitCount;
+ src_pitch = ((width * depth / 8) + 3) & ~3;
info.rtStart = start_time;
info.rtEnd = end_time;
@@ -285,21 +286,21 @@ static HRESULT WINAPI VMR9_DoRenderSample(struct strmbase_renderer *iface, IMedi
{
dst -= locked_rect.Pitch;
memcpy(dst, src, width * depth / 8);
- src += width * depth / 8;
+ src += src_pitch;
}
}
- else if (locked_rect.Pitch != width * depth / 8)
+ else if (locked_rect.Pitch != src_pitch)
{
BYTE *dst = locked_rect.pBits;
const BYTE *src = data;
TRACE("Source pitch %u does not match dest pitch %u; copying manually.\n",
- width * depth / 8, locked_rect.Pitch);
+ src_pitch, locked_rect.Pitch);
while (height--)
{
memcpy(dst, src, width * depth / 8);
- src += width * depth / 8;
+ src += src_pitch;
dst += locked_rect.Pitch;
}
}
More information about the wine-cvs
mailing list