mirror of
https://github.com/WonderfulToolchain/psxavenc.git
synced 2026-02-02 03:26:05 +00:00
When using format `PSX_AUDIO_XA_FORMAT_XACD`, `psx_audio_xa_encode_init_sector` calls `psx_cdrom_init_sector`, which calls `psx_cdrom_init_xa_subheader`, which zeroes out the subheader. But when using `PSX_AUDIO_XA_FORMAT_XA`, `psx_audio_xa_encode_init_sector` doesn't call either init function, which leaves `coding` uninitialized. All of the other subheader fields are assigned directly, so they aren't affected, but `coding` is only OR'd with flags, so it can become corrupted. This could be fixed just by changing the first OR with an assignment, but this PR instead calls `psx_cdrom_init_xa_subheader` directly when the format is `PSX_AUDIO_XA_FORMAT_XA`.