avformat/ttaenc: Avoid stack packet

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
pull/369/head
Andreas Rheinhardt 4 years ago
parent 9b41fddf3e
commit 751e334aa9
  1. 8
      libavformat/ttaenc.c

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

Loading…
Cancel
Save