mesa: Skip 3-byte array formats in _mesa_array_format_flip_channels
authorMichel Dänzer <mdaenzer@redhat.com>
Fri, 24 Apr 2020 09:40:14 +0000 (11:40 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 27 Apr 2020 14:14:00 +0000 (14:14 +0000)
commitc50bbfa0ab513a771167b3885fdbb2b5c75d2384
treeed9f7d1392284c8f13a6822ddf32fc7bb3c65fcb
parentad5da3e63ee368e3fa420d4785c698273614683b
mesa: Skip 3-byte array formats in _mesa_array_format_flip_channels

Byte swapping makes no sense for 3-byte formats: Swapping the order of 2
or 4 bytes at a time would inevitably result in bytes getting mixed up
between neighbouring pixels.

Fixes crash with a debugging build on a big endian machine due hitting
the unreachable() at the end of the function.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2665
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4735>
src/mesa/main/formats.c