[vlc-commits] direct3d9: Don't copy from an odd offset

Hugo Beauzée-Luyssen git at videolan.org
Thu Jun 1 11:55:44 CEST 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed May 31 18:31:19 2017 +0200| [4a4d32f251cda32a2aee0fff9a49563da8c6f0cb] | committer: Hugo Beauzée-Luyssen

direct3d9: Don't copy from an odd offset

This can (and often will) make StretchRect fail

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4a4d32f251cda32a2aee0fff9a49563da8c6f0cb
---

 modules/video_output/win32/direct3d9.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 002cd92d3b..dacc850c8f 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -1566,7 +1566,9 @@ static int Direct3D9ImportPicture(vout_display_t *vd,
     // When copying the entire buffer, the margin end up being blended in the actual picture
     // on nVidia (regardless of even/odd dimensions)
     if ( copy_rect.right & 1 ) copy_rect.right++;
+    if ( copy_rect.left & 1 ) copy_rect.left--;
     if ( copy_rect.bottom & 1 ) copy_rect.bottom++;
+    if ( copy_rect.top & 1 ) copy_rect.top--;
     hr = IDirect3DDevice9_StretchRect(sys->d3ddev, source, &copy_rect, destination,
                                       &copy_rect, D3DTEXF_NONE);
     IDirect3DSurface9_Release(destination);



More information about the vlc-commits mailing list