From 3561688742016c82c6c146e448949112255b234c Mon Sep 17 00:00:00 2001
From: Fabian Bieler <[email protected]>
Date: Sat, 2 Apr 2011 13:52:34 +0200
Subject: [PATCH 1/3] mesa: Guard against null pointer deref in fbo validation
This matches the behaviour below when numSamples is compared.
At least with the gallium state tracker this can actually occur if st_render_texture fails.
---
src/mesa/main/fbobject.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 4eab3e1..b91f1fe 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -746,7 +746,8 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx,
continue;
}
- if (numSamples < 0) {
+ if (att->Renderbuffer &&
+ numSamples < 0) {
/* first buffer */
numSamples = att->Renderbuffer->NumSamples;
}
--
1.7.4.1
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev