• Jörn Heusipp's avatar
    Fix reading maximum, nominal, minimum bitrate in _vorbis_unpack_info(). · 68ebc894
    Jörn Heusipp authored
    https://xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-630004.2.2 specifies
    these fields as 32bit signed. oggpack_read(opb,32), which is used to
    read these fields, returns 32 bits stored in a long. On architectures
    where long is 64bit, this results in a positive value being returned.
    This value is then stored in struct vorbis_info in bitrate_upper,
    bitrate_nominal and bitrate_lower, also as long. ogginfo relies on
    these values in order to display the respective header fields and thus
    misrepresented the stored value -1 (which has the intended meaning of
    "bitrate not set") as 2**32-1 on architectures where long is 64bit.
    
    Explicitly cast the return value of oggpack_read() to a signed 32bit
    integer type.
    
    A nominal bitrate value of -1 is valid as per specification, and is
    written by libvorbis for VBR files with samplerate >= 50000Hz.
    Signed-off-by: Timothy B. Terriberry's avatarTimothy B. Terriberry <tterribe@xiph.org>
    68ebc894
Name
Last commit
Last update
debian Loading commit data...
doc Loading commit data...
examples Loading commit data...
include Loading commit data...
lib Loading commit data...
m4 Loading commit data...
macosx Loading commit data...
symbian Loading commit data...
test Loading commit data...
vq Loading commit data...
win32 Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
AUTHORS Loading commit data...
CHANGES Loading commit data...
CMakeLists.txt Loading commit data...
COPYING Loading commit data...
Makefile.am Loading commit data...
README.md Loading commit data...
appveyor.yml Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
libvorbis.spec.in Loading commit data...
vorbis-uninstalled.pc.in Loading commit data...
vorbis.m4 Loading commit data...
vorbis.pc.in Loading commit data...
vorbisenc-uninstalled.pc.in Loading commit data...
vorbisenc.pc.in Loading commit data...
vorbisfile-uninstalled.pc.in Loading commit data...
vorbisfile.pc.in Loading commit data...