[FFmpeg-cvslog] jvdec: fix memleak of jv->frames

Paul B Mahol git at videolan.org
Tue Jul 3 11:54:29 CEST 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Jul  3 09:51:44 2012 +0000| [596814f9781772050c65bdd8add27445bc8374a4] | committer: Paul B Mahol

jvdec: fix memleak of jv->frames

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=596814f9781772050c65bdd8add27445bc8374a4
---

 libavformat/jvdec.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libavformat/jvdec.c b/libavformat/jvdec.c
index 504be08..e7594b9 100644
--- a/libavformat/jvdec.c
+++ b/libavformat/jvdec.c
@@ -216,6 +216,15 @@ static int read_seek(AVFormatContext *s, int stream_index,
     return 0;
 }
 
+static int read_close(AVFormatContext *s)
+{
+    JVDemuxContext *jv = s->priv_data;
+
+    av_freep(&jv->frames);
+
+    return 0;
+}
+
 AVInputFormat ff_jv_demuxer = {
     .name           = "jv",
     .long_name      = NULL_IF_CONFIG_SMALL("Bitmap Brothers JV"),
@@ -224,4 +233,5 @@ AVInputFormat ff_jv_demuxer = {
     .read_header    = read_header,
     .read_packet    = read_packet,
     .read_seek      = read_seek,
+    .read_close     = read_close,
 };



More information about the ffmpeg-cvslog mailing list