Mesa (8.0): mesa: Fix copy-and-paste error in _mesa_pack_rgba_span_float

Ian Romanick idr at kemper.freedesktop.org
Thu Feb 2 18:51:57 UTC 2012


Module: Mesa
Branch: 8.0
Commit: d45d250ad102f22b7e1b51bd6d68366b8f5ca7ff
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d45d250ad102f22b7e1b51bd6d68366b8f5ca7ff

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Wed Feb  1 22:46:31 2012 -0700

mesa: Fix copy-and-paste error in _mesa_pack_rgba_span_float

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 at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
(cherry picked from commit 2e8f8cb383320b83ba5d85c27808ac2d841834e6)

---

 src/mesa/main/pack.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c
index f874ab2..ad76c98 100644
--- a/src/mesa/main/pack.c
+++ b/src/mesa/main/pack.c
@@ -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:




More information about the mesa-commit mailing list