Skip to content
Snippets Groups Projects
Verified Commit 3862c100 authored by Mark Harris's avatar Mark Harris
Browse files

opusenc: Sanitize sample rate, fix rate from AIFF

Fix errors (not affecting common values) in reading the sample rate
from AIFF: the low 32 bits of the mantissa were incorrectly interpreted
as signed, the first byte rather than first bit was being used as
a sign, and non-integer rates were not properly rounded.

Although the sample rate is validated prior to setting up the
resampler, sample rates outside the range of an "int" could cause
undefined behavior prior to that when cast from double to int for
AIFF. Such rates could also be incorrect for WAV on 32-bit builds.
Ensure that the rate is within the range of an int prior to casting.
parent bd7489f6
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment