[FFmpeg-cvslog] r22431 - trunk/libavformat/ffmdec.c

Benoit Fouet benoit.fouet
Wed Mar 10 15:11:18 CET 2010


On Wed, 10 Mar 2010 14:17:50 +0100 (CET) vitor wrote:
> Author: vitor
> Date: Wed Mar 10 14:17:50 2010
> New Revision: 22431
> 
> Log:
> Fix memory leak in FFM demuxer
> 
> Modified:
>    trunk/libavformat/ffmdec.c
> 
> Modified: trunk/libavformat/ffmdec.c
> ==============================================================================
> --- trunk/libavformat/ffmdec.c	Wed Mar 10 13:29:44 2010	(r22430)
> +++ trunk/libavformat/ffmdec.c	Wed Mar 10 14:17:50 2010	(r22431)
> @@ -512,6 +512,14 @@ static int ffm_probe(AVProbeData *p)
>      return 0;
>  }
>  
> +static void ffm_close(AVFormatContext *s)
> +{
> +    int i;
> +
> +    for (i = 0; i < s->nb_streams; i++)
> +        av_freep(&s->streams[i]->codec->rc_eq);
> +}
> +
>  AVInputFormat ffm_demuxer = {
>      "ffm",
>      NULL_IF_CONFIG_SMALL("FFM (FFserver live feed) format"),
> @@ -519,6 +527,6 @@ AVInputFormat ffm_demuxer = {
>      ffm_probe,
>      ffm_read_header,
>      ffm_read_packet,
> -    NULL,
> +    ffm_close,
>      ffm_seek,
>  };

libavformat/ffmdec.c:530: warning: initialization from incompatible pointer type

following patch fixes it:

diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 90c806f..ff61f21 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -512,12 +512,14 @@ static int ffm_probe(AVProbeData *p)
     return 0;
 }

-static void ffm_close(AVFormatContext *s)
+static int ffm_close(AVFormatContext *s)
 {
     int i;

     for (i = 0; i < s->nb_streams; i++)
         av_freep(&s->streams[i]->codec->rc_eq);
+
+    return 0;
 }

 AVInputFormat ffm_demuxer = {



More information about the ffmpeg-cvslog mailing list