mirror of
https://github.com/mpv-player/mpv
synced 2025-01-10 17:09:45 +00:00
demux_lavf: Adding av_dup_packet() missing from recent 6e8d420a41
Commit 6e8d420a41
("demux: avoid a copy of demux packets with lavf,
reduce padding") was missing an av_dup_packet() line. As a result at
least formats that use parsing on the lavf side could fail (with
parsing the packet may contain pointers to temporary fields that
will be overwritten/freed when reading further packets, and
av_dup_packet() is required to allocate permanent storage).
This commit is contained in:
parent
47f5d53d85
commit
2c5285c151
@ -800,6 +800,11 @@ static int demux_lavf_fill_buffer(demuxer_t *demux, demux_stream_t *dsds)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// If the packet has pointers to temporary fields that could be
|
||||
// overwritten/freed by next av_read_frame(), copy them to persistent
|
||||
// allocations so we can safely queue the packet for any length of time.
|
||||
if (av_dup_packet(pkt) < 0)
|
||||
abort();
|
||||
dp = new_demux_packet_fromdata(pkt->data, pkt->size);
|
||||
dp->avpacket = pkt;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user