[FFmpeg-cvslog] cafenc: do not leak caf->pkt_sizes
Paul B Mahol
git at videolan.org
Fri Feb 22 14:55:16 CET 2013
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Feb 22 13:51:06 2013 +0000| [c46400ddecab3a47e8f1aec9a405bbe2a321b06a] | committer: Paul B Mahol
cafenc: do not leak caf->pkt_sizes
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c46400ddecab3a47e8f1aec9a405bbe2a321b06a
---
libavformat/cafenc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavformat/cafenc.c b/libavformat/cafenc.c
index 40ccd48..11bb055 100644
--- a/libavformat/cafenc.c
+++ b/libavformat/cafenc.c
@@ -238,11 +238,11 @@ static int caf_write_packet(AVFormatContext *s, AVPacket *pkt)
static int caf_write_trailer(AVFormatContext *s)
{
+ CAFContext *caf = s->priv_data;
AVIOContext *pb = s->pb;
AVCodecContext *enc = s->streams[0]->codec;
if (pb->seekable) {
- CAFContext *caf = s->priv_data;
int64_t file_size = avio_tell(pb);
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); ///< mRemainderFrames
avio_write(pb, caf->pkt_sizes, caf->size_entries_used);
- av_freep(&caf->pkt_sizes);
caf->size_buffer_size = 0;
}
avio_flush(pb);
}
+ av_freep(&caf->pkt_sizes);
return 0;
}
More information about the ffmpeg-cvslog
mailing list