diff --git a/src/opengl/gltexture.cpp b/src/opengl/gltexture.cpp index 6c24d7f8f0..4f9e96cfa4 100644 --- a/src/opengl/gltexture.cpp +++ b/src/opengl/gltexture.cpp @@ -587,6 +587,7 @@ std::unique_ptr GLTexture::upload(const QImage &image) } glBindTexture(GL_TEXTURE_2D, texture); + glPixelStorei(GL_UNPACK_ROW_LENGTH, im.bytesPerLine() / (im.depth() / 8)); if (!context->isOpenGLES()) { if (context->supportsTextureStorage()) { glTexStorage2D(GL_TEXTURE_2D, 1, internalFormat, im.width(), im.height()); @@ -598,6 +599,7 @@ std::unique_ptr GLTexture::upload(const QImage &image) } else { glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, im.width(), im.height(), 0, format, type, im.constBits()); } + glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); glBindTexture(GL_TEXTURE_2D, 0); return std::unique_ptr(new GLTexture(GL_TEXTURE_2D, texture, internalFormat, image.size(), 1, true, OutputTransform::FlipY));