Skip to content
  • Filip Roséen's avatar
    mkv: replaced manual memory-management with std::vector in matroska_segment_c · 553febf4
    Filip Roséen authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
    
    
    Manually managing memory comes at a cost of both maintainability (in
    terms of safety) and performance, as such I have replaced `p_indexes`
    with a `std::vector` with equivalent functionality.
    
    Three helper member-functions have been introduced in order to clean up
    the usage of the functionality, as well as removal of two now obsolete
    member-variables. A `typedef` has also been introduced to aid future
    development.
    
    The changes in `mkv.cpp` are due to the fact that it needs access to the
    indexes present in `matroska_segment_c`; this should be refactored away
    in the future.
    
    Also fixed a bug where you would access index out of bounds if there
    are no known indexes.
    
    Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
    553febf4