• James Cowgill's avatar
    Fix free of uninitialized memory if seek fails in ov_raw_seek · 128f0f81
    James Cowgill authored
    If _seek_helper fails in ov_raw_seek, control jumps to the seek_error
    label which calls ogg_stream_clear on work_os. However, at this point
    in the function, work_os is not initialized so we end up attempting to
    free some uninitialized memory and crashing.
    
    Fix by removing the call to ogg_stream_clear. This is safe because the
    only code path to seek_error happens before work_os is initialized (so
    there is never anything to free anyway).
    
    I also refactor the code a bit:
    - Remove the ret variable which is unnessesary since we can just pass
      the result of _seek_helper directly to the if.
    - Since seek_error is only used once, move the contents of that block
      to the if statement so we can remove a goto.
    128f0f81
Name
Last commit
Last update
contrib/oss-fuzz Loading commit data...
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...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
Brewfile 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...