[vlc-commits] copy: fix memory corruption in SSE Nv12 to Yv12 conversion

Thomas Guillem git at videolan.org
Fri May 19 09:39:53 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri May 19 09:22:52 2017 +0200| [e70f7c6a894d0818db6e720b91de845823ea5543] | committer: Thomas Guillem

copy: fix memory corruption in SSE Nv12 to Yv12 conversion

This fixes a regression introduced by f9f0bbc1396af8816c3d6b6dfe222d911de61047

This memory corruption was not visible since this function is generally used
to copy from GPU mapped buffers, that are often bigger than what you ask.

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

 modules/video_chroma/copy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/video_chroma/copy.c b/modules/video_chroma/copy.c
index 444d47a7a7..f40fd08454 100644
--- a/modules/video_chroma/copy.c
+++ b/modules/video_chroma/copy.c
@@ -298,7 +298,7 @@ static void SSE_SplitPlanes(uint8_t *dstu, size_t dstu_pitch,
                             uint8_t *cache, size_t cache_size,
                             unsigned height, unsigned cpu)
 {
-    const unsigned w16 = (2*src_pitch+15) & ~15;
+    const unsigned w16 = (src_pitch+15) & ~15;
     const unsigned hstep = cache_size / w16;
     assert(hstep > 0);
 
@@ -307,7 +307,7 @@ static void SSE_SplitPlanes(uint8_t *dstu, size_t dstu_pitch,
 
         /* Copy a bunch of line into our cache */
         CopyFromUswc(cache, w16, src, src_pitch,
-                     2*src_pitch, hblock, cpu);
+                     src_pitch, hblock, cpu);
 
         /* Copy from our cache to the destination */
         SSE_SplitUV(dstu, dstu_pitch, dstv, dstv_pitch,



More information about the vlc-commits mailing list