• Timothy B. Terriberry's avatar
    ogg: Fix borken stream resets. · d6aeeebe
    Timothy B. Terriberry authored
    Commit 78a8771f attempted to reset the ogg_stream_state in
    find_last_frame(), but it tries to do so using a non-existent page
    and then leaks memory (due to using ogg_stream_init() instead of
    ogg_stream_reset()). Its caller, Ogg_GetLastPacket(), then tries
    to restore the contents of the current packet, but its call to
    ogg_stream_pageseek() will immediately fail, leaving the dangling
    packet pointers untouched.
    
    Instead, just back up the whole stream state and restore it on
    exit. This fixes both problems.
    Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
    d6aeeebe
ogg.c 87.3 KB