Skip to content
  • Michael Pyne's avatar
    Fix undefined behavior in PlaylistItem. · b67785f9
    Michael Pyne authored
    The PlaylistItem ctor meant to be called from its subclass's constructor
    (CollectionListItem) copied the this pointer too early. When
    PlaylistItem is being constructed, by C++ rules the PlaylistItem is not
    a CollectionListItem yet. This was appropriately flagged by ubsan.
    
    I fixed this by ensuring the only user of this subclass fixes up the
    pointer as soon as it can, and making it a private constructor so it's
    not used elsewhere by mistake.
    b67785f9