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:
Uoti Urpala 2011-08-21 21:55:32 +03:00
parent 47f5d53d85
commit 2c5285c151
1 changed files with 5 additions and 0 deletions

View File

@ -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;