Commit 83a9666f authored by Ivan Gyurdiev's avatar Ivan Gyurdiev Committed by Alexandre Julliard

wined3d: Fix NULL dereference in generator function.

parent 4d66615b
......@@ -623,6 +623,9 @@ void generate_base_shader(
shader_reg_maps reg_maps;
/* Initialize current parsing state */
SHADER_OPCODE_ARG hw_arg;
hw_arg.shader = iface;
hw_arg.buffer = buffer;
This->baseShader.parse_state.current_row = 0;
/* First pass: figure out which temporary and texture registers are used */
......@@ -662,8 +665,9 @@ void generate_base_shader(
/* Read opcode */
opcode_token = *pToken++;
curOpcode = shader_get_opcode(iface, opcode_token);
hw_fct = (wined3d_settings.shader_mode ==
SHADER_GLSL ? curOpcode->hw_glsl_fct : curOpcode->hw_fct);
hw_fct = (curOpcode == NULL)? NULL:
(wined3d_settings.shader_mode == SHADER_GLSL)?
curOpcode->hw_glsl_fct : curOpcode->hw_fct;
/* Unknown opcode and its parameters */
if (NULL == curOpcode) {
......@@ -673,11 +677,7 @@ void generate_base_shader(
/* If a generator function is set for current shader target, use it */
} else if (hw_fct != NULL) {
SHADER_OPCODE_ARG hw_arg;
hw_arg.shader = iface;
hw_arg.opcode = curOpcode;
hw_arg.buffer = buffer;
if (curOpcode->num_params > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment