From 6d548653bda1c06558df5d3ed898b0649ed64336 Mon Sep 17 00:00:00 2001 From: wankanzhen Date: Fri, 14 Aug 2020 11:00:31 +0800 Subject: [PATCH] add null judge --- src/anbox/graphics/emugl/ColorBuffer.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/anbox/graphics/emugl/ColorBuffer.cpp b/src/anbox/graphics/emugl/ColorBuffer.cpp index 51798c77..7d67ba3c 100644 --- a/src/anbox/graphics/emugl/ColorBuffer.cpp +++ b/src/anbox/graphics/emugl/ColorBuffer.cpp @@ -128,6 +128,9 @@ ColorBuffer* ColorBuffer::create(EGLDisplay p_display, int p_width, } ColorBuffer* cb = new ColorBuffer(p_display, helper, hndl); + if (!cb) { + return NULL; + } s_gles2.glGenTextures(1, &cb->m_tex); s_gles2.glBindTexture(GL_TEXTURE_2D, cb->m_tex); @@ -172,6 +175,9 @@ ColorBuffer* ColorBuffer::create(EGLDisplay p_display, int p_width, } cb->m_resizer = new TextureResize(p_width, p_height); + if (!(cb->m_resizer)) { + return NULL; + } return cb; } @@ -322,6 +328,9 @@ bool ColorBuffer::bindToRenderbuffer() { return false; } RenderThreadInfo* tInfo = RenderThreadInfo::get(); + if (!tInfo) { + return false; + } if (!tInfo->currContext) { return false; } -- GitLab