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

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


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

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

May fix #19529

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

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

diff --git a/modules/hw/d3d9/dxa9.c b/modules/hw/d3d9/dxa9.c
index 7ebed928e7..d5d46073bf 100644
--- a/modules/hw/d3d9/dxa9.c
+++ b/modules/hw/d3d9/dxa9.c
@@ -119,7 +119,8 @@ static void DXA9_YV12(filter_t *p_filter, picture_t *src, picture_t *dst)
             lock.Pitch,
         };
         Copy420_SP_to_P(dst, plane, pitch,
-                        src->format.i_visible_height + src->format.i_y_offset, p_copy_cache);
+                        __MIN(desc.Height, src->format.i_y_offset + src->format.i_visible_height),
+                        p_copy_cache);
         picture_SwapUV(dst);
     } else {
         msg_Err(p_filter, "Unsupported DXA9 conversion from 0x%08X to YV12", desc.Format);
@@ -148,7 +149,9 @@ static void DXA9_NV12(filter_t *p_filter, picture_t *src, picture_t *dst)
             lock.Pitch,
             lock.Pitch,
         };
-        Copy420_SP_to_SP(dst, plane, pitch, desc.Height, p_copy_cache);
+        Copy420_SP_to_SP(dst, plane, pitch,
+                         __MIN(desc.Height, src->format.i_y_offset + src->format.i_visible_height),
+                         p_copy_cache);
     } else {
         msg_Err(p_filter, "Unsupported DXA9 conversion from 0x%08X to NV12", desc.Format);
     }



More information about the vlc-commits mailing list