Skip to content
  • Max Kellermann's avatar
    stream_decoder: reset has_seek_table before read_metadata_seektable_() · a52177b0
    Max Kellermann authored and Erik de Castro Lopo's avatar Erik de Castro Lopo committed
    
    
    If a seek table has already been read successfully, then the
    has_seek_table flag is true.  Now imagine the file comes with another
    seek table, which doesn't make sense, but libFLAC accepts it happily.
    If reading this second seek table fails (for example allocation
    failure), read_metadata_seektable_() returns false, but the
    has_seek_table flag is still true.  If the calling application happens
    to ignore this failure, and at some point tries to seek, the process
    will crash due to NULL pointer dereference.  This would sure be an
    application bug that needs to be fixed, but libFLAC's internal state
    is inconsistent, so let's fix this up.
    
    Signed-off-by: default avatarErik de Castro Lopo <erikd@mega-nerd.com>
    a52177b0