breaks subs (was Re: [Mplayer-cvslog] CVS: main mplayer.c, 1.763, 1.764)

pl p_l at gmx.fr
Sun Jul 25 01:47:01 CEST 2004


Hi,

* Alexander Strasser (beastd) <syncmail at mplayerhq.hu> [2004-07-23 18:24]:
> CVS change done by Alexander Strasser (beastd)
> 
> Update of /cvsroot/mplayer/main
> In directory mail:/var2/tmp/cvs-serv15022
> 
> Modified Files:
> 	mplayer.c 
> Log Message:
> false-use-of-get_path() memleak fixes.

This patch has a broken chunk (missing {}) => causes segfaults when
subtitles are loaded.

> Index: mplayer.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/mplayer.c,v
> retrieving revision 1.763
> retrieving revision 1.764
> diff -u -r1.763 -r1.764
> --- mplayer.c	17 Jul 2004 12:47:12 -0000	1.763
> +++ mplayer.c	23 Jul 2004 16:10:21 -0000	1.764
[...]
> @@ -1649,11 +1652,13 @@
>      char *psub = get_path( "sub/" );
>      char **tmp = sub_filenames((psub ? psub : ""), filename);
>      char **tmp2 = tmp;
> +    free(psub); // release the buffer created by get_path() above
>      while (*tmp2)
>          add_subtitles (*tmp2++, sh_video->fps, 0);
>      free(tmp);
>      if (set_of_sub_size == 0)
> -        add_subtitles (get_path("default.sub"), sh_video->fps, 1);

+ {

> +        add_subtitles (mem_ptr=get_path("default.sub"), sh_video->fps, 1);
> +    free(mem_ptr); // release the buffer created by get_path()

+ }

>      if (set_of_sub_size > 0)
>          add_subtitles (NULL, sh_video->fps, 1);
>    }

Best regards,
-- 
Pierre Lombard




More information about the MPlayer-cvslog mailing list