• Rodger Combs's avatar
    lavf/segment: fix crash when failing to open segment list · 2b202900
    Rodger Combs authored
    This happens because segment_end() returns an error, so seg_write_packet
    never proceeds to segment_start(), and seg->avf->pb is never re-set,
    so we crash with a null pb when av_write_trailer flushes the packet
    queue.
    
    This doesn't seem to be clearly recoverable, so I'm just failing more
    gracefully.
    
    Repro:
    ffmpeg -i input.ts -f segment -c copy -segment_list /noaxx.m3u8 test-%05d.ts
    
    (assuming you don't have write access to /)
    2b202900
segment.c 40.8 KB