Mesa (10.1): i965: Fix crash in do_blit_readpixels()
Carl Worth
cworth at kemper.freedesktop.org
Fri May 2 00:06:09 UTC 2014
Module: Mesa
Branch: 10.1
Commit: ddd1cc774aa2487bd8143f492e62b6179fc6ddba
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ddd1cc774aa2487bd8143f492e62b6179fc6ddba
Author: Anuj Phogat <anuj.phogat at gmail.com>
Date: Wed Mar 19 11:55:50 2014 -0700
i965: Fix crash in do_blit_readpixels()
Fixes a crash in Khronos CTS packed_pixels tests.
Cc: <mesa-stable at lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
(cherry picked from commit d714b20eb4617f24b496a09028a90fdd8c19b5bd)
---
src/mesa/drivers/dri/i965/intel_pixel_read.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/intel_pixel_read.c b/src/mesa/drivers/dri/i965/intel_pixel_read.c
index 600d288..8cd7579 100644
--- a/src/mesa/drivers/dri/i965/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/i965/intel_pixel_read.c
@@ -34,6 +34,7 @@
#include "main/bufferobj.h"
#include "main/readpix.h"
#include "main/state.h"
+#include "main/glformats.h"
#include "brw_context.h"
#include "intel_screen.h"
@@ -89,6 +90,12 @@ do_blit_readpixels(struct gl_context * ctx,
struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
struct intel_renderbuffer *irb = intel_renderbuffer(rb);
+ /* Currently this function only supports reading from color buffers. */
+ if (!_mesa_is_color_format(format))
+ return false;
+
+ assert(irb != NULL);
+
if (ctx->_ImageTransferState ||
!_mesa_format_matches_format_and_type(irb->mt->format, format, type,
false)) {
More information about the mesa-commit
mailing list