[PATCH 0/1] MR2699: evr: Don't flip image vertically.
This is actually fixing two issues: - if we get a negative stride, then the video transform should have already flipped vertically the image, so we don't need to flip it again. (This is another side effect for handling negative strides in wg_transform). - it also fixes a crash in AoEII, as the image source line offsets were incorrectly computed with unsigned arithmetic (while signed arithmetic was expected), resulting in incorrect sign propagation from 32bit to 64bit integers. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2699
From: Eric Pouech <epouech(a)codeweavers.com> This is actually fixing two issues: - if we get a negative stride, then the video transform should have already flipped vertically the image, so we don't need to flip it again. (This is another side effect for handling negative strides in wg_transform). - it also fixes a crash in AoEII, as the image source line offsets were incorrectly computed with unsigned arithmetic (while signed arithmetic was expected), resulting in incorrect sign propagation from 32bit to 64bit integers. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- dlls/evr/evr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/evr/evr.c b/dlls/evr/evr.c index 26a2a3a1eb5..25785ea97ab 100644 --- a/dlls/evr/evr.c +++ b/dlls/evr/evr.c @@ -382,8 +382,7 @@ static HRESULT evr_copy_sample_buffer(struct evr *filter, IMediaSample *input_sa { if (SUCCEEDED(hr = IDirect3DSurface9_LockRect(surface, &locked_rect, NULL, D3DLOCK_DISCARD))) { - if (src_stride < 0) src -= src_stride * (lines - 1); - MFCopyImage(locked_rect.pBits, locked_rect.Pitch, src, src_stride, width * 4, lines); + MFCopyImage(locked_rect.pBits, locked_rect.Pitch, src, abs(src_stride), width * 4, lines); IDirect3DSurface9_UnlockRect(surface); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2699
This is actually fixing two issues:
* if we get a negative stride, then the video transform should have already flipped vertically the image, so we don't need to flip it again. (This is another side effect for handling negative strides in wg_transform).
This does not explain much, because EVR does not require a transform.
* it also fixes a crash in AoEII, as the image source line offsets were incorrectly computed with unsigned arithmetic (while signed arithmetic was expected), resulting in incorrect sign propagation from 32bit to 64bit integers.
Is it possible to test EVR in isolation to validate this change? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2699#note_31011
closing (bug I was chasing was due to an incorrect integration of other changes) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2699#note_31484
This merge request was closed by eric pouech. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2699
participants (3)
-
Eric Pouech -
eric pouech (@epo) -
Nikolay Sivov (@nsivov)