summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/swrast/s_readpix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index cca7ec00802..5604c2e937e 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -344,9 +344,9 @@ read_rgba_pixels( struct gl_context *ctx,
_swrast_read_rgba_span(ctx, rb, width, x, y, GL_FLOAT, rgba);
/* apply fudge factor for shallow color buffers */
- if (fb->Visual.redBits < 8 ||
- fb->Visual.greenBits < 8 ||
- fb->Visual.blueBits < 8) {
+ if ((fb->Visual.redBits < 8 && fb->Visual.redBits != 0) ||
+ (fb->Visual.greenBits < 8 && fb->Visual.greenBits != 0) ||
+ (fb->Visual.blueBits < 8 && fb->Visual.blueBits != 0)) {
adjust_colors(fb, width, rgba);
}