[PATCH 2/6] wined3d: Fix clamping in reading rectangular YV12 textures

Martin Storsjo martin at martin.st
Tue Feb 11 05:14:55 CST 2014


The lower bound for chroma components is size.y + 1/2, not
size.y - 1/2.
---
I wasn't able to test this codepath properly, but I noticed
this while reading the code.
---
 dlls/wined3d/arb_program_shader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 8aa67cf..6d17ea3 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -7006,7 +7006,7 @@ static BOOL gen_yv12_read(struct wined3d_shader_buffer *buffer, GLenum textype,
         shader_addline(buffer, "MAD temp.y, size.y, coef.w, size.y;\n");
         shader_addline(buffer, "ADD temp.y, temp.y, -coef.y;\n");
         shader_addline(buffer, "MIN texcrd.y, temp.y, texcrd.y;\n");
-        shader_addline(buffer, "ADD temp.y, size.y, -coef.y;\n");
+        shader_addline(buffer, "ADD temp.y, size.y, coef.y;\n");
         shader_addline(buffer, "MAX texcrd.y, temp.y, texcrd.y;\n");
     }
     /* Read the texture, put the result into the output register */
-- 
1.8.3.4 (Apple Git-47)




More information about the wine-patches mailing list