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
wilder/Plasma/6.2
Vlad Zahorodnii 2 years ago
parent a6743fd2f5
commit 9240d75e51
  1. 4
      src/plugins/screencast/screencastutils.h

@ -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…
Cancel
Save