diff options
author | Jose Fonseca <jfonseca@vmware.com> | 2016-04-11 21:32:45 +0100 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2016-04-11 21:32:45 +0100 |
commit | 581249bc5691eac32f3be5ec78ad729db155ecd6 (patch) | |
tree | ee23c62a6c94d1f42fbe1f5824cfa2eca2e88adc /retrace/glretrace_glx.cpp | |
parent | 52567c368498180166129ba086e433a158960b6f (diff) |
glretrace: Replay crashed glXMakeCurrent calls without crashing.
Fixes https://github.com/apitrace/apitrace/issues/445
Diffstat (limited to 'retrace/glretrace_glx.cpp')
-rw-r--r-- | retrace/glretrace_glx.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/retrace/glretrace_glx.cpp b/retrace/glretrace_glx.cpp index 944debcf..5450d906 100644 --- a/retrace/glretrace_glx.cpp +++ b/retrace/glretrace_glx.cpp @@ -103,9 +103,8 @@ static void retrace_glXCreateContextAttribsARB(trace::Call &call) { } static void retrace_glXMakeCurrent(trace::Call &call) { - bool ret = call.ret->toBool(); - if (!ret) { - // If false is returned then any previously current rendering context + if (call.ret && !call.ret->toBool()) { + // If false was returned then any previously current rendering context // and drawable remain unchanged. return; } @@ -191,9 +190,8 @@ static void retrace_glXDestroyPbuffer(trace::Call &call) { } static void retrace_glXMakeContextCurrent(trace::Call &call) { - bool ret = call.ret->toBool(); - if (!ret) { - // If false is returned then any previously current rendering context + if (call.ret && !call.ret->toBool()) { + // If false was returned then any previously current rendering context // and drawable remain unchanged. return; } |