plugins/screencast: Don't download texture data if target size and texture size mismatch
If glGetTexImage() gets called, it can write beyond the bounds of the target size. In long term, it would be nice to relax this check. CCBUG: 489764
This commit is contained in:
parent
a6743fd2f5
commit
9240d75e51
1 changed files with 4 additions and 0 deletions
|
@ -41,6 +41,10 @@ static GLenum closestGLType(QImage::Format format)
|
|||
|
||||
static void doGrabTexture(GLTexture *texture, QImage *target)
|
||||
{
|
||||
if (texture->size() != target->size()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto context = OpenGlContext::currentContext();
|
||||
const QSize size = texture->size();
|
||||
const bool invertNeeded = context->isOpenGLES() ^ (texture->contentTransform() != OutputTransform::FlipY);
|
||||
|
|
Loading…
Reference in a new issue