From c7339d42c603048c0f89276da6576647c4421ba0 Mon Sep 17 00:00:00 2001 From: Fabian Bieler Date: Tue, 5 Apr 2011 07:51:01 -0600 Subject: [PATCH] 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. Signed-off-by: Brian Paul --- src/mesa/main/fbobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index f0065ad06a9..eb1fef51427 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -746,7 +746,7 @@ _mesa_test_framebuffer_completeness(struct gl_context *ctx, continue; } - if (numSamples < 0) { + if (att->Renderbuffer && numSamples < 0) { /* first buffer */ numSamples = att->Renderbuffer->NumSamples; } -- 2.30.2