Skip to content

u_format: Use memcpy to avoid unaligned accesses

Matt Turner requested to merge mattst88/mesa:u_format-unaligned-access into main

These functions are used by gl[Get]TexImage, which imposes no alignment restructions on the void *pixels parameter.

This fixes an unaligned access in GTK's "gtk:gdk / memorytexture" unit test on SPARC, which causes the test to fail.

Fixes: 45ae4434 ("util: Use bitshift arithmetic to unpack pixels.")

Merge request reports