Mesa (master): mesa: Check the lookup_framebuffer return value in NamedFramebufferRenderbuffer

Fredrik Höglund fredrik at kemper.freedesktop.org
Sat May 16 17:57:38 UTC 2015


Module: Mesa
Branch: master
Commit: 5a55f681f6208122cd4921b283cffd54ea335128
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5a55f681f6208122cd4921b283cffd54ea335128

Author: Fredrik Höglund <fredrik at kde.org>
Date:   Sat May 16 19:43:39 2015 +0200

mesa: Check the lookup_framebuffer return value in NamedFramebufferRenderbuffer

Found by Coverity.

Reported-by: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

---

 src/mesa/main/fbobject.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 8db651c..1859c27 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -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,




More information about the mesa-commit mailing list