From 5084858c7ac36110b7bc3554e983b50b62e5e9a7 Mon Sep 17 00:00:00 2001 From: Zhaowei Yuan Date: Tue, 20 Sep 2016 02:42:51 +0800 Subject: [PATCH] coregl_fastpath: Fix NULL pointer access Check if gctx->gl_current_program is NULL before accessing it Signed-off-by: Zhaowei Yuan Change-Id: I48521476422be2cb3c7d77af6df47ddc96ca069f --- src/modules/fastpath/coregl_fastpath_gl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/fastpath/coregl_fastpath_gl.c b/src/modules/fastpath/coregl_fastpath_gl.c index 816065e..4a8ec58 100644 --- a/src/modules/fastpath/coregl_fastpath_gl.c +++ b/src/modules/fastpath/coregl_fastpath_gl.c @@ -247,7 +247,7 @@ void fastpath_release_gl_context(GLGlueContext *gctx) { // Release program - if (gctx->gl_current_program[0] != 0) { + if (gctx->gl_current_program && gctx->gl_current_program[0] != 0) { _detach_program_object(&gctx->ostate, gctx->gl_current_program[0], 1, 0); gctx->gl_current_program[0] = 0; } -- 2.7.4