mesa: Check the lookup_framebuffer return value in NamedFramebufferRenderbuffer
authorFredrik Höglund <fredrik@kde.org>
Sat, 16 May 2015 17:43:39 +0000 (19:43 +0200)
committerFredrik Höglund <fredrik@kde.org>
Sat, 16 May 2015 17:55:00 +0000 (19:55 +0200)
Found by Coverity.

Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/mesa/main/fbobject.c

index 8db651ca2a146a07cce6525f33f109837f847f10..1859c277293b565f5254e2ab9a1cdda8b142062c 100644 (file)
@@ -3362,6 +3362,8 @@ _mesa_NamedFramebufferRenderbuffer(GLuint framebuffer, GLenum attachment,
 
    fb = _mesa_lookup_framebuffer_err(ctx, framebuffer,
                                      "glNamedFramebufferRenderbuffer");
+   if (!fb)
+      return;
 
    if (renderbuffertarget != GL_RENDERBUFFER) {
       _mesa_error(ctx, GL_INVALID_ENUM,