[PATCH 2/5] wined3d: Don't read modifiers for opcodes with "read_opcode_func" set (AFL).
Henri Verbeet
hverbeet at codeweavers.com
Thu Mar 9 03:37:05 CST 2017
Otherwise "len" would be inconsistent with "p". This assumes opcodes with
"read_opcode_func" either don't have modifiers or handle them themselves.
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
dlls/wined3d/shader_sm4.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c
index 8986d35..ef68754 100644
--- a/dlls/wined3d/shader_sm4.c
+++ b/dlls/wined3d/shader_sm4.c
@@ -1570,10 +1570,6 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi
p = *ptr;
*ptr += len;
- previous_token = opcode_token;
- while (previous_token & WINED3D_SM4_INSTRUCTION_MODIFIER)
- shader_sm4_read_instruction_modifier(previous_token = *p++, ins);
-
if (opcode_info->read_opcode_func)
{
opcode_info->read_opcode_func(ins, opcode, opcode_token, p, len, priv);
@@ -1582,6 +1578,10 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi
{
enum wined3d_shader_dst_modifier instruction_dst_modifier = WINED3DSPDM_NONE;
+ previous_token = opcode_token;
+ while (previous_token & WINED3D_SM4_INSTRUCTION_MODIFIER && p != *ptr)
+ shader_sm4_read_instruction_modifier(previous_token = *p++, ins);
+
ins->flags = (opcode_token & WINED3D_SM4_INSTRUCTION_FLAGS_MASK) >> WINED3D_SM4_INSTRUCTION_FLAGS_SHIFT;
if (ins->flags & WINED3D_SM4_INSTRUCTION_FLAG_SATURATE)
--
2.1.4
More information about the wine-patches
mailing list