avcodec/vorbisdec: don't use double intermediate in vorbisfloat2float

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2024-06-11 22:50:50 -03:00
parent 1b9af306da
commit 08383443ff
1 changed files with 3 additions and 3 deletions

View File

@ -181,11 +181,11 @@ static const char idx_err_str[] = "Index value %d out of range (0 - %d) for %s a
static float vorbisfloat2float(unsigned val)
{
double mant = val & 0x1fffff;
long exp = (val & 0x7fe00000L) >> 21;
float mant = val & 0x1fffff;
int exp = (val & 0x7fe00000) >> 21;
if (val & 0x80000000)
mant = -mant;
return ldexp(mant, exp - 20 - 768);
return ldexpf(mant, exp - 20 - 768);
}