mesa: handle missing read buffer in _mesa_get_color_read_format/type()
authorBrian Paul <brianp@vmware.com>
Mon, 3 Jun 2013 00:07:55 +0000 (18:07 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 3 Jun 2013 00:12:07 +0000 (18:12 -0600)
commite20a2df4017ab10dd7199936948c6ac809bfacb6
treea8fb243c584348bcc55c91414176e9ab7a2c8e05
parentdcc5b6bfb79261779d85325239d75a2e1f3bec37
mesa: handle missing read buffer in _mesa_get_color_read_format/type()

We were crashing when GL_READ_BUFFER == GL_NONE.  Check for NULL
pointers and reorganize the code.  The spec doesn't say which error
to generate in this situation, but NVIDIA raises GL_INVALID_OPERATION.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65173
NOTE: This is a candidate for the stable branches.

Tested-by: Vedran Rodic <vrodic@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/mesa/main/framebuffer.c