From e518cb863edc931888ccca6cad86f73ca7430cef Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Tue, 3 Jul 2012 09:51:44 +0000 Subject: [PATCH] jvdec: Fix memory leak of jv->frames Signed-off-by: Luca Barbato --- libavformat/jvdec.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libavformat/jvdec.c b/libavformat/jvdec.c index caf29a8..6bf220f 100644 --- a/libavformat/jvdec.c +++ b/libavformat/jvdec.c @@ -59,6 +59,15 @@ static int read_probe(AVProbeData *pd) return 0; } +static int read_close(AVFormatContext *s) +{ + JVDemuxContext *jv = s->priv_data; + + av_freep(&jv->frames); + + return 0; +} + static int read_header(AVFormatContext *s) { JVDemuxContext *jv = s->priv_data; @@ -229,4 +238,5 @@ AVInputFormat ff_jv_demuxer = { .read_header = read_header, .read_packet = read_packet, .read_seek = read_seek, + .read_close = read_close, }; -- 2.7.4