[libav-commits] nutenc: mux chapters.

Message ID 20110317160350.GC18946@zohar.khirnov.net
State Committed
Headers show

Commit Message

Anton Khirnov March 17, 2011, 4:03 p.m.
On Thu, Mar 17, 2011 at 03:45:03PM +0000, Måns Rullgård wrote:
> "Anton Khirnov " <git@libav.org> writes:
> 
> > Module: libav
> > Branch: master
> > Commit: 073f8b10d8d7638fcee33aba04ca2a7b90bdb2c3
> >
> > Author:    Anton Khirnov <anton@khirnov.net>
> > Committer: Luca Barbato <lu_zero@gentoo.org>
> > Date:      Wed Mar 16 06:42:43 2011 +0100
> >
> > nutenc: mux chapters.
> >
> > Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
> >
> > ---
> >
> >  libavformat/nut.h    |    5 ++++
> >  libavformat/nutenc.c |   66 ++++++++++++++++++++++++++++++++++++++++++++++---
> >  2 files changed, 67 insertions(+), 4 deletions(-)
> 
> Valgrind seems a little unhappy about this:
> 
> ==1799== 0 bytes in 1 blocks are definitely lost in loss record 1 of 1
> ==1799==    at 0x4D92136: memalign (vg_replace_malloc.c:581)
> ==1799==    by 0x4D92193: posix_memalign (vg_replace_malloc.c:709)
> ==1799==    by 0x85424B5: av_mallocz (mem.c:83)
> ==1799==    by 0x810703B: write_header (nutenc.c:588)
> ==1799==    by 0x8137CFF: av_write_header (utils.c:2879)
> ==1799==    by 0x80807D2: T.690 (ffmpeg.c:2447)
> ==1799==    by 0x8080B68: main (ffmpeg.c:4359)
> 

Oops, really sorry about that.
Fix attached.

Comments

Mans Rullgard March 17, 2011, 4:25 p.m. | #1
Anton Khirnov <anton@khirnov.net> writes:

> On Thu, Mar 17, 2011 at 03:45:03PM +0000, Måns Rullgård wrote:
>> "Anton Khirnov " <git@libav.org> writes:
>> 
>> > Module: libav
>> > Branch: master
>> > Commit: 073f8b10d8d7638fcee33aba04ca2a7b90bdb2c3
>> >
>> > Author:    Anton Khirnov <anton@khirnov.net>
>> > Committer: Luca Barbato <lu_zero@gentoo.org>
>> > Date:      Wed Mar 16 06:42:43 2011 +0100
>> >
>> > nutenc: mux chapters.
>> >
>> > Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
>> >
>> > ---
>> >
>> >  libavformat/nut.h    |    5 ++++
>> >  libavformat/nutenc.c |   66 ++++++++++++++++++++++++++++++++++++++++++++++---
>> >  2 files changed, 67 insertions(+), 4 deletions(-)
>> 
>> Valgrind seems a little unhappy about this:
>> 
>> ==1799== 0 bytes in 1 blocks are definitely lost in loss record 1 of 1
>> ==1799==    at 0x4D92136: memalign (vg_replace_malloc.c:581)
>> ==1799==    by 0x4D92193: posix_memalign (vg_replace_malloc.c:709)
>> ==1799==    by 0x85424B5: av_mallocz (mem.c:83)
>> ==1799==    by 0x810703B: write_header (nutenc.c:588)
>> ==1799==    by 0x8137CFF: av_write_header (utils.c:2879)
>> ==1799==    by 0x80807D2: T.690 (ffmpeg.c:2447)
>> ==1799==    by 0x8080B68: main (ffmpeg.c:4359)
>> 
>
> Oops, really sorry about that.
> Fix attached.
>
> -- 
> Anton Khirnov
>
> From c1dd248082acafe7f88793f1628142940a441aff Mon Sep 17 00:00:00 2001
> From: Anton Khirnov <anton@khirnov.net>
> Date: Thu, 17 Mar 2011 17:00:21 +0100
> Subject: [PATCH] nutenc: fix a memleak.
>
> ---
>  libavformat/nutenc.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
> index 86701fa..fafbae8 100644
> --- a/libavformat/nutenc.c
> +++ b/libavformat/nutenc.c
> @@ -846,6 +846,7 @@ static int write_trailer(AVFormatContext *s){
>      avio_flush(bc);
>      ff_nut_free_sp(nut);
>      av_freep(&nut->stream);
> +    av_freep(&nut->chapter);
>      av_freep(&nut->time_base);
>  
>      return 0;
> -- 
> 1.7.4.1

Looks good, pushing.

Patch

From c1dd248082acafe7f88793f1628142940a441aff Mon Sep 17 00:00:00 2001
From: Anton Khirnov <anton@khirnov.net>
Date: Thu, 17 Mar 2011 17:00:21 +0100
Subject: [PATCH] nutenc: fix a memleak.

---
 libavformat/nutenc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index 86701fa..fafbae8 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -846,6 +846,7 @@  static int write_trailer(AVFormatContext *s){
     avio_flush(bc);
     ff_nut_free_sp(nut);
     av_freep(&nut->stream);
+    av_freep(&nut->chapter);
     av_freep(&nut->time_base);
 
     return 0;
-- 
1.7.4.1