diff mbox series

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

Message ID AM7PR03MB6660ACB291E8C7B862D1031C8FD29@AM7PR03MB6660.eurprd03.prod.outlook.com
State New
Headers show
Series [FFmpeg-devel,01/11] avformat/mux: Sanitize packets without data and side-data
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 6, 2021, 2:27 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/ttaenc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

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