VirtGL: Fix TDIS-7153 Emulator crashed with WebGL Conformance test
authorFrédéric Dalleau <frederic.dalleau@linux.intel.com>
Tue, 20 Aug 2013 14:09:40 +0000 (16:09 +0200)
committerjinhyung.jo <jinhyung.jo@samsung.com>
Wed, 11 Sep 2013 09:10:47 +0000 (18:10 +0900)
This fix allows some of WebGL test to pass without crashing the emulator.

tizen/src/hw/opengl_exec.c

index df118cec36dfbdc05d432691d25db5a048690cab..064fd9ad58d68525743ba21d7563786144bd8b7e 100644 (file)
@@ -526,7 +526,7 @@ static char *compute_gl_extensions() {
 static inline QGloSurface *get_qsurface_from_client_drawable(GLState *state, ClientGLXDrawable client_drawable) {
     QGloSurface *qsurface;
 
-    if(state->current_qsurface->client_drawable == client_drawable)
+    if (state->current_qsurface && state->current_qsurface->client_drawable == client_drawable)
         return state->current_qsurface;
 
     QTAILQ_FOREACH(qsurface, &state->qsurfaces, next) {
@@ -1604,7 +1604,8 @@ int do_function_call(ProcessState *process, int func_number, unsigned long *args
 
             // We have to assume the current context here
             // since we assume that a drawable must belong to a specific context
-            render_surface(qsurface, bpp, stride, render_buffer);
+            if (qsurface)
+                render_surface(qsurface, bpp, stride, render_buffer);
             break;
 
         }