mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-04-09 10:49:00 +00:00
cafenc: do not leak caf->pkt_sizes
Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
21f68528e3
commit
c46400ddec
@ -238,11 +238,11 @@ static int caf_write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
|
|
||||||
static int caf_write_trailer(AVFormatContext *s)
|
static int caf_write_trailer(AVFormatContext *s)
|
||||||
{
|
{
|
||||||
|
CAFContext *caf = s->priv_data;
|
||||||
AVIOContext *pb = s->pb;
|
AVIOContext *pb = s->pb;
|
||||||
AVCodecContext *enc = s->streams[0]->codec;
|
AVCodecContext *enc = s->streams[0]->codec;
|
||||||
|
|
||||||
if (pb->seekable) {
|
if (pb->seekable) {
|
||||||
CAFContext *caf = s->priv_data;
|
|
||||||
int64_t file_size = avio_tell(pb);
|
int64_t file_size = avio_tell(pb);
|
||||||
|
|
||||||
avio_seek(pb, caf->data, SEEK_SET);
|
avio_seek(pb, caf->data, SEEK_SET);
|
||||||
@ -256,11 +256,11 @@ static int caf_write_trailer(AVFormatContext *s)
|
|||||||
avio_wb32(pb, 0); ///< mPrimingFrames
|
avio_wb32(pb, 0); ///< mPrimingFrames
|
||||||
avio_wb32(pb, 0); ///< mRemainderFrames
|
avio_wb32(pb, 0); ///< mRemainderFrames
|
||||||
avio_write(pb, caf->pkt_sizes, caf->size_entries_used);
|
avio_write(pb, caf->pkt_sizes, caf->size_entries_used);
|
||||||
av_freep(&caf->pkt_sizes);
|
|
||||||
caf->size_buffer_size = 0;
|
caf->size_buffer_size = 0;
|
||||||
}
|
}
|
||||||
avio_flush(pb);
|
avio_flush(pb);
|
||||||
}
|
}
|
||||||
|
av_freep(&caf->pkt_sizes);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user