aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-03-18 22:00:39 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-10-03 20:56:12 +0200
commitf42a2b13496e6a5286164fd7241d64aebf74ec4e (patch)
tree4f4c641d160c42de8e35f5411d031f4fef6451a3
parent12a88f806f4984a6afea5939f02e1ac962731e55 (diff)
downloadffmpeg-f42a2b13496e6a5286164fd7241d64aebf74ec4e.tar.gz
avformat/flacenc: Avoid stack packet
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavformat/flacenc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/flacenc.c b/libavformat/flacenc.c
index 44c9341493..f884e5d2c8 100644
--- a/libavformat/flacenc.c
+++ b/libavformat/flacenc.c
@@ -299,7 +299,7 @@ static int flac_write_audio_packet(struct AVFormatContext *s, AVPacket *pkt)
static int flac_queue_flush(AVFormatContext *s)
{
FlacMuxerContext *c = s->priv_data;
- AVPacket pkt;
+ AVPacket *const pkt = ffformatcontext(s)->pkt;
int ret, write = 1;
ret = flac_finish_header(s);
@@ -307,10 +307,10 @@ static int flac_queue_flush(AVFormatContext *s)
write = 0;
while (c->queue) {
- avpriv_packet_list_get(&c->queue, &c->queue_end, &pkt);
- if (write && (ret = flac_write_audio_packet(s, &pkt)) < 0)
+ avpriv_packet_list_get(&c->queue, &c->queue_end, pkt);
+ if (write && (ret = flac_write_audio_packet(s, pkt)) < 0)
write = 0;
- av_packet_unref(&pkt);
+ av_packet_unref(pkt);
}
return ret;
}