Commit c46400dd authored by Paul B Mahol's avatar Paul B Mahol

cafenc: do not leak caf->pkt_sizes

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 21f68528
...@@ -238,11 +238,11 @@ static int caf_write_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -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) ...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment