avformat/ttaenc: Avoid stack packet

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-03-18 07:16:43 +01:00
parent 9b41fddf3e
commit 751e334aa9
1 changed files with 4 additions and 4 deletions

View File

@ -123,12 +123,12 @@ static int tta_write_packet(AVFormatContext *s, AVPacket *pkt)
static void tta_queue_flush(AVFormatContext *s)
{
TTAMuxContext *tta = s->priv_data;
AVPacket pkt;
AVPacket *const pkt = ffformatcontext(s)->pkt;
while (tta->queue) {
avpriv_packet_list_get(&tta->queue, &tta->queue_end, &pkt);
avio_write(s->pb, pkt.data, pkt.size);
av_packet_unref(&pkt);
avpriv_packet_list_get(&tta->queue, &tta->queue_end, pkt);
avio_write(s->pb, pkt->data, pkt->size);
av_packet_unref(pkt);
}
}