From 5b38f1cf2e88a9f1af881a19b4ac2cd2dda07d64 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Thu, 27 Apr 2017 14:05:44 +0300 Subject: [PATCH] d3dx9/tests: Fix test blob data corruption in test_preshader_op(). Signed-off-by: Paul Gofman Signed-off-by: Matteo Bruni Signed-off-by: Alexandre Julliard --- dlls/d3dx9_36/tests/effect.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c index f7d7ba82972..997c1fc7a57 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c @@ -4415,12 +4415,13 @@ static void test_preshader_op(IDirect3DDevice9 *device, const DWORD *sample_effe { unsigned int pos; unsigned int result_index; + unsigned int ins_count; } blob_position[] = { - {0, 0}, - {5549, 0}, - {5400, 2} + {0, 0, 0}, + {5549, 0, 4}, + {5400, 2, 1} }; DWORD *test_effect_blob; HRESULT hr; @@ -4436,7 +4437,7 @@ static void test_preshader_op(IDirect3DDevice9 *device, const DWORD *sample_effe test_effect_blob = HeapAlloc(GetProcessHeap(), 0, sample_effect_blob_size); memcpy(test_effect_blob, sample_effect_blob, sample_effect_blob_size); - for (i = 0; i < 4; ++i) + for (i = 0; i < blob_position[test->args_count].ins_count; ++i) test_effect_blob[op_pos + i * op_step] = test->opcode; hr = D3DXCreateEffect(device, test_effect_blob, sample_effect_blob_size,