From e3a0668f552b133a75fdf2e9e2e0984b898d4d9d Mon Sep 17 00:00:00 2001 From: Themaister Date: Fri, 28 Dec 2012 21:25:41 +0100 Subject: [PATCH] Fix segfault when samples < 8 on NEON. --- audio/utils.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/audio/utils.c b/audio/utils.c index 4d7b202592..22aa546435 100644 --- a/audio/utils.c +++ b/audio/utils.c @@ -141,7 +141,8 @@ void audio_convert_s16_to_float_neon(float *out, const int16_t *in, size_t sampl (void)gain; // gain is ignored for now. size_t aligned_samples = samples & ~7; - audio_convert_s16_float_asm(out, in, aligned_samples); + if (aligned_samples) + audio_convert_s16_float_asm(out, in, aligned_samples); // Could do all conversion in ASM, but keep it simple for now. audio_convert_s16_to_float_C(out + aligned_samples, in + aligned_samples, @@ -152,7 +153,9 @@ void audio_convert_float_s16_asm(int16_t *out, const float *in, size_t samples); void audio_convert_float_to_s16_neon(int16_t *out, const float *in, size_t samples) { size_t aligned_samples = samples & ~7; - audio_convert_float_s16_asm(out, in, aligned_samples); + if (aligned_samples) + audio_convert_float_s16_asm(out, in, aligned_samples); + audio_convert_float_to_s16_C(out + aligned_samples, in + aligned_samples, samples - aligned_samples); }