]> git.alsa-project.org Git - alsa-utils.git/commit
axfer: Fix creation of v1.2 headers on big-endian systems
authorSamuel Holland <samuel@sholland.org>
Sun, 21 Apr 2019 00:15:54 +0000 (19:15 -0500)
committerJaroslav Kysela <perex@perex.cz>
Tue, 7 May 2019 06:28:31 +0000 (08:28 +0200)
commit60f78865d305a90195167e2148a0ee20f9e17628
treeaa1487192e955eb08ac42f33a3e047b455a9839d
parent551cc37fc66dc3be0a1423788b70bfa7e7501721
axfer: Fix creation of v1.2 headers on big-endian systems

struct block_v120_format defines these members as uint8_t. On
little-endian systems, no swapping is done, and the generated block
header is fine. However, on big-endian machines, the value is swapped to
the high byte and then truncated by the assignment, causing both
bits_per_sample and samples_per_frame to be zero.

This fixes an assertion failure in container-test when later
parsing the header ["assert(*samples_per_frame > 0);" in
container_context_pre_process()].

Fixes: 4ab7510f3a18: ("axfer: add support for a container of Creative Tech. voice format")
Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
axfer/container-voc.c