diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-03-18 07:28:03 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-10-03 20:56:12 +0200 |
commit | 0bf63099cd0c0dac27e3bd3f8fb1c873a4523e1e (patch) | |
tree | 4adcc4da7b948d69b76b5feb1a7983724880472b /libavformat/mp3enc.c | |
parent | 751e334aa91bcba596c77d7cd3b78e7c5f93ef44 (diff) | |
download | ffmpeg-0bf63099cd0c0dac27e3bd3f8fb1c873a4523e1e.tar.gz |
avformat/mp3enc: Avoid stack packet
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/mp3enc.c')
-rw-r--r-- | libavformat/mp3enc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index c8328b8b9d..e4b2a65b07 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@ -381,17 +381,17 @@ static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt) static int mp3_queue_flush(AVFormatContext *s) { MP3Context *mp3 = s->priv_data; - AVPacket pkt; + AVPacket *const pkt = ffformatcontext(s)->pkt; int ret = 0, write = 1; ff_id3v2_finish(&mp3->id3, s->pb, s->metadata_header_padding); mp3_write_xing(s); while (mp3->queue) { - avpriv_packet_list_get(&mp3->queue, &mp3->queue_end, &pkt); - if (write && (ret = mp3_write_audio_packet(s, &pkt)) < 0) + avpriv_packet_list_get(&mp3->queue, &mp3->queue_end, pkt); + if (write && (ret = mp3_write_audio_packet(s, pkt)) < 0) write = 0; - av_packet_unref(&pkt); + av_packet_unref(pkt); } return ret; } |