[Mesa-dev] [PATCH] mesa: Avoid segfault when getting an unbound transform feedback buffer name.

Kenneth Graunke kenneth at whitecape.org
Wed Jan 4 02:44:39 PST 2012


On 01/03/2012 02:11 PM, Paul Berry wrote:
> Previously we were using
> gl_transform_feedback_object::Buffers[i]->Name to service an indexed
> get request for GL_TRANSFORM_FEEDBACK_BUFFER_BINDING.  However, if no
> buffer has been bound, gl_transform_feedback_object::Buffers[i] is
> NULL, so this was causing a segfault.
> 
> This patch switches to using
> gl_transform_feedback_object::BufferNames[i], which is equal to
> gl_transform_feedback_object::Buffers[i]->Name if
> gl_transform_feedback_object::Buffers[i] is not NULL, and 0 if it is
> NULL.
> 
> Fixes piglit test "EXT_transform_feedback/get-buffer-state
> indexed_binding".

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>



More information about the mesa-dev mailing list