[vlc-commits] hw:d3d11: don't copy lines that will not be visible

Steve Lhomme git at videolan.org
Mon Jan 22 17:37:29 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Jan 22 17:30:59 2018 +0100| [3db333e33ca5589606dea8fcac3ac9c3f195d7f1] | committer: Steve Lhomme

hw:d3d11: don't copy lines that will not be visible

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

 modules/hw/d3d11/d3d11_surface.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index e9c6483a50..d45117dd1a 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -380,7 +380,8 @@ static void D3D11_YUY2(filter_t *p_filter, picture_t *src, picture_t *dst)
             lock.RowPitch,
         };
         Copy420_SP_to_P(dst, plane, pitch,
-                        src->format.i_visible_height + src->format.i_y_offset, &sys->cache);
+                        __MIN(desc.Height, src->format.i_y_offset + src->format.i_visible_height),
+                        &sys->cache);
         picture_SwapUV(dst);
     } else {
         msg_Err(p_filter, "Unsupported D3D11VA conversion from 0x%08X to YV12", desc.Format);
@@ -486,7 +487,9 @@ static void D3D11_NV12(filter_t *p_filter, picture_t *src, picture_t *dst)
             lock.RowPitch,
             lock.RowPitch,
         };
-        Copy420_SP_to_SP(dst, plane, pitch, desc.Height, &sys->cache);
+        Copy420_SP_to_SP(dst, plane, pitch,
+                         __MIN(desc.Height, src->format.i_y_offset + src->format.i_visible_height),
+                         &sys->cache);
     } else {
         msg_Err(p_filter, "Unsupported D3D11VA conversion from 0x%08X to NV12", desc.Format);
     }



More information about the vlc-commits mailing list