[vlc-commits] d3d11_quad: fix buffer overrun

Steve Lhomme git at videolan.org
Mon Oct 22 11:59:10 CEST 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Oct 22 11:57:02 2018 +0200| [c575cef1799bf346c693a2c7f8fe529f7b6c73f6] | committer: Steve Lhomme

d3d11_quad: fix buffer overrun

CID #322961

(cherry picked from commit 23e5d8de7c216444317e4f9dd93714b76f27c0a9)

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

 modules/video_output/win32/d3d11_quad.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/win32/d3d11_quad.c b/modules/video_output/win32/d3d11_quad.c
index c3d1369aaa..b113ed6e96 100644
--- a/modules/video_output/win32/d3d11_quad.c
+++ b/modules/video_output/win32/d3d11_quad.c
@@ -807,12 +807,14 @@ static void GetPrimariesTransform(FLOAT Primaries[4*4], video_color_primaries_t
     /* src[RGB] -> src[XYZ] -> dst[XYZ] -> dst[RGB] */
     Float3x3Multiply(xyz2rgb, rgb2xyz);
 
-    for (size_t i=0;i<4; ++i)
+    for (size_t i=0;i<3; ++i)
     {
         for (size_t j=0;j<3; ++j)
             Primaries[j + i*4] = xyz2rgb[j + i*3];
-        Primaries[3 + i*4] = i == 3;
+        Primaries[3 + i*4] = 0;
     }
+    for (size_t j=0;j<4; ++j)
+        Primaries[j + 3*4] = j == 3;
 }
 
 #undef D3D11_SetupQuad



More information about the vlc-commits mailing list