audioconvert: fix s24_32 to float

s24_32 needs to be sign extended before converting to float because the
upper bits are undefined and might be anything.

Fixes #1393
This commit is contained in:
Wim Taymans 2021-07-06 12:42:39 +02:00
parent aab72ded6e
commit 3a879e8b1a
2 changed files with 13 additions and 9 deletions

View file

@ -60,6 +60,9 @@
#define S32_TO_F32(v) S24_TO_F32((v) >> 8)
#define F32_TO_S32(v) (F32_TO_S24(v) << 8)
#define S24_32_TO_F32(v) S32_TO_F32((v)<<8)
#define F32_TO_S24_32(v) F32_TO_S24(v)
static inline int32_t read_s24(const void *src)
{
const int8_t *s = src;