coregl_fastpath: Fix NULL pointer access 55/88655/2
authorZhaowei Yuan <zhaowei.yuan@samsung.com>
Mon, 19 Sep 2016 18:42:51 +0000 (02:42 +0800)
committerGwan-gyeong Mun <kk.moon@samsung.com>
Thu, 29 Sep 2016 10:43:35 +0000 (03:43 -0700)
Check if gctx->gl_current_program is NULL before
accessing it

Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com>
Change-Id: I48521476422be2cb3c7d77af6df47ddc96ca069f

src/modules/fastpath/coregl_fastpath_gl.c

index 816065e..4a8ec58 100644 (file)
@@ -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;
        }