• Timothy B. Terriberry's avatar
    ogg: Fix borken stream resets. · 1e604e1f
    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>
    (cherry picked from commit d6aeeebe0c7ec9f4defe1751454bc3c1943d84e1)
    Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
    1e604e1f
oggseek.c 24.8 KB