From: Matthias Clasen Date: Wed, 31 May 2023 02:35:45 +0000 (-0400) Subject: gltexture: Use proper alignment for downloads X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~199^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f29c7e76f5fc2a66fafb3e77597132a2b9a66e9b;p=gtk4.git gltexture: Use proper alignment for downloads --- diff --git a/gdk/gdkgltexture.c b/gdk/gdkgltexture.c index 6e72af5403..d9d62190d9 100644 --- a/gdk/gdkgltexture.c +++ b/gdk/gdkgltexture.c @@ -204,6 +204,7 @@ gdk_gl_texture_do_download (GdkGLTexture *self, gsize stride = texture->width * gdk_memory_format_bytes_per_pixel (format); guchar *pixels = g_malloc_n (stride, texture->height); + glPixelStorei (GL_PACK_ALIGNMENT, 1); glGetTexImage (GL_TEXTURE_2D, 0, gl_format, @@ -271,6 +272,7 @@ gdk_gl_texture_do_download (GdkGLTexture *self, gsize stride = actual_bpp * texture->width; guchar *pixels = g_malloc_n (stride, texture->height); + glPixelStorei (GL_PACK_ALIGNMENT, 1); glReadPixels (0, 0, texture->width, texture->height, gl_read_format,