Commit d5e8e196 by Frank Henigman Committed by Commit Bot

Check FunctionsEGL::terminatePtr before use.

FunctionsEGL::terminatePtr could be null if initialization failed, so check it before use to avoid crashing. Change-Id: Ide9378c8e26749ab9d58c01cb36cd923836cde98 Reviewed-on: https://chromium-review.googlesource.com/506627Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
parent e9ed3d86
...@@ -184,7 +184,7 @@ egl::Error FunctionsEGL::initialize(EGLNativeDisplayType nativeDisplay) ...@@ -184,7 +184,7 @@ egl::Error FunctionsEGL::initialize(EGLNativeDisplayType nativeDisplay)
egl::Error FunctionsEGL::terminate() egl::Error FunctionsEGL::terminate()
{ {
if (mFnPtrs->terminatePtr(mEGLDisplay) == EGL_TRUE) if (mFnPtrs->terminatePtr == nullptr || mFnPtrs->terminatePtr(mEGLDisplay) == EGL_TRUE)
{ {
mEGLDisplay = nullptr; mEGLDisplay = nullptr;
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment