[FFmpeg-devel] [PATCH 22/34] avformat/ttaenc: Avoid stack packet

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Mon Sep 6 05:27:50 EEST 2021


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavformat/ttaenc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/ttaenc.c b/libavformat/ttaenc.c
index 5f66695a9a..842dee52dc 100644
--- a/libavformat/ttaenc.c
+++ b/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 = s->internal->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);
     }
 }
 
-- 
2.30.2



More information about the ffmpeg-devel mailing list