mesa: Fix copy-and-paste error in _mesa_pack_rgba_span_float
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 2 Feb 2012 05:46:31 +0000 (22:46 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 2 Feb 2012 17:07:14 +0000 (10:07 -0700)
GL_RG_INTEGER only has two components, not three.  I'll be surprised
if anyone ever tries to glReadPixels(..., GL_SHORT, GL_RG_INTEGER,
...).  This was found by inspection.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/pack.c

index d07e2aaa87a29acb051d366f74291b0de92061f3..41485a1bf061ae11ab29c2e246523286d461d40c 100644 (file)
@@ -1175,9 +1175,8 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4],
                   break;
                case GL_RG_INTEGER:
                   for (i=0;i<n;i++) {
-                     dst[i*3+0] = (GLshort) rgba[i][RCOMP];
-                     dst[i*3+1] = (GLshort) rgba[i][GCOMP];
-                     dst[i*3+2] = (GLshort) rgba[i][BCOMP];
+                     dst[i*2+0] = (GLshort) rgba[i][RCOMP];
+                     dst[i*2+1] = (GLshort) rgba[i][GCOMP];
                   }
                   break;
                case GL_RGB_INTEGER_EXT: