pipeline-state: Fix crash in the get_all_uniform_values function

The get_all_uniform_values function tries to walk the parent hierarchy
of pipelines to find pipelines overriding the uniforms state and then
grabs the values from the override. However it was accessing data
inside the ‘big state’ even if the pipeline didn't override the
uniforms state so it would crash if it encountered a parent pipeline
with no big state.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
This commit is contained in:
Neil Roberts 2012-02-13 18:48:17 +00:00
parent a654dac122
commit f84839e87c

View File

@ -273,6 +273,8 @@ _cogl_pipeline_get_all_uniform_values (CoglPipeline *pipeline,
data.dst_values = values;
do
{
if ((pipeline->differences & COGL_PIPELINE_STATE_UNIFORMS))
{
const CoglPipelineUniformsState *uniforms_state =
&pipeline->big_state->uniforms_state;
@ -280,11 +282,10 @@ _cogl_pipeline_get_all_uniform_values (CoglPipeline *pipeline,
data.override_count = 0;
data.src_values = uniforms_state->override_values;
if ((pipeline->differences & COGL_PIPELINE_STATE_UNIFORMS))
_cogl_bitmask_foreach (&uniforms_state->override_mask,
get_uniforms_cb,
&data);
}
pipeline = _cogl_pipeline_get_parent (pipeline);
}
while (pipeline);