• Marth64's avatar
    avformat/subtitles: extend ff_subtitles_queue_insert() to support not yet available events · 1c353336
    Marth64 authored
    If ff_subtitles_queue_insert() were given a NULL buffer
    with 0 length, it would still attempt to grow the packet
    or memcpy depending on if merge option is enabled.
    
    In this commit, allow passing a NULL buffer with 0 length
    without attempting to do such operations. This way, if a
    subtitle demuxer happens to pass an empty cue or wants to
    use av_get_packet() to read bytes, there are no unnecessary
    operations on the packet after it is allocated.
    Signed-off-by: 's avatarMarth64 <marth64@proxyid.net>
    1c353336
subtitles.h 7.57 KB