[alsa-devel] axfer: Fix creation of v1.2 headers on big-endian systems

GitHub pull_request - opened github at alsa-project.org
Sun Apr 21 02:23:03 CEST 2019


alsa-project/alsa-utils pull request #15 was opened from smaeul:

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()].

Signed-off-by: Samuel Holland <samuel at sholland.org>

Request URL   : https://github.com/alsa-project/alsa-utils/pull/15
Patch URL     : https://github.com/alsa-project/alsa-utils/pull/15.patch
Repository URL: https://github.com/alsa-project/alsa-utils


More information about the Alsa-devel mailing list