mirror of
https://github.com/librempeg/librempeg
synced 2024-11-23 11:39:47 +00:00
avformat/flacenc: Avoid stack packet
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
12a88f806f
commit
f42a2b1349
@ -299,7 +299,7 @@ static int flac_write_audio_packet(struct AVFormatContext *s, AVPacket *pkt)
|
|||||||
static int flac_queue_flush(AVFormatContext *s)
|
static int flac_queue_flush(AVFormatContext *s)
|
||||||
{
|
{
|
||||||
FlacMuxerContext *c = s->priv_data;
|
FlacMuxerContext *c = s->priv_data;
|
||||||
AVPacket pkt;
|
AVPacket *const pkt = ffformatcontext(s)->pkt;
|
||||||
int ret, write = 1;
|
int ret, write = 1;
|
||||||
|
|
||||||
ret = flac_finish_header(s);
|
ret = flac_finish_header(s);
|
||||||
@ -307,10 +307,10 @@ static int flac_queue_flush(AVFormatContext *s)
|
|||||||
write = 0;
|
write = 0;
|
||||||
|
|
||||||
while (c->queue) {
|
while (c->queue) {
|
||||||
avpriv_packet_list_get(&c->queue, &c->queue_end, &pkt);
|
avpriv_packet_list_get(&c->queue, &c->queue_end, pkt);
|
||||||
if (write && (ret = flac_write_audio_packet(s, &pkt)) < 0)
|
if (write && (ret = flac_write_audio_packet(s, pkt)) < 0)
|
||||||
write = 0;
|
write = 0;
|
||||||
av_packet_unref(&pkt);
|
av_packet_unref(pkt);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user