Permalink
Browse files

Make the previous context current only if it's not null

  • Loading branch information...
magomez committed Dec 21, 2017
1 parent 9ed2cdf commit aad8ad2c8ceb1ddc2e58a25a6bf292b6d58b1607
Showing with 2 additions and 2 deletions.
  1. +2 −2 Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp
@@ -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.
@@ -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;
}

0 comments on commit aad8ad2

Please sign in to comment.