Skip to content

Commit

Permalink
Make the previous context current only if it's not null
Browse files Browse the repository at this point in the history
  • Loading branch information
magomez committed Dec 21, 2017
1 parent 9ed2cdf commit aad8ad2
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -152,7 +152,6 @@ bool VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture(GLuint input

// Save previous context and activate the sharing one.
GLContext* previousContext = GLContext::current();
ASSERT(previousContext);
PlatformDisplay::sharedDisplayForCompositing().sharingGLContext()->makeContextCurrent();

// Save previous bound framebuffer, texture and viewport.
Expand Down Expand Up @@ -212,7 +211,8 @@ bool VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture(GLuint input
bool ok = (glGetError() == GL_NO_ERROR);

// Restore previous context.
previousContext->makeContextCurrent();
if (previousContext)
previousContext->makeContextCurrent();
return ok;
}

Expand Down

0 comments on commit aad8ad2

Please sign in to comment.