Skip to content

Commit

Permalink
Merge pull request #229 from carmiker/master
Browse files Browse the repository at this point in the history
ai: Fix segfault when built against musl-libc
  • Loading branch information
PeterLemon committed Jun 19, 2022
2 parents 474bf47 + 3615ddf commit 9092d1c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ai/controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const char *ai_register_mnemonics[NUM_AI_REGISTERS] = {
};
#endif

static cen64_align(uint8_t buf[0x40000], 16);

static void ai_dma(struct ai_controller *ai);
static const uint8_t *byteswap_audio_buffer(const uint8_t *input,
uint8_t *output, uint32_t length);
Expand Down Expand Up @@ -125,7 +127,6 @@ void ai_dma(struct ai_controller *ai) {
}

if (ai->ctx.unqueued_buffers > 0) {
cen64_align(uint8_t buf[0x40000], 16);
uint32_t length = ai->fifo[ai->fifo_ri].length;
uint8_t *input = bus->ri->ram + ai->fifo[ai->fifo_ri].address;
const uint8_t *buf_ptr = byteswap_audio_buffer(input, buf, length);
Expand Down

0 comments on commit 9092d1c

Please sign in to comment.