[vlc-devel] [vlc-commits] subtitle: fix a potential memory leak

Jean-Baptiste Kempf jb at videolan.org
Fri Nov 10 13:31:21 CET 2017


Hello Garf!

Welcome Back!

:D

On Fri, 10 Nov 2017, at 10:43, Simon Latapie wrote:
> vlc | branch: master | Simon Latapie <garf at videolan.org> | Tue Nov  7
> 19:39:04 2017 +0100| [e96860acd9993f7409d335018987af73ecc3d947] |
> committer: Thomas Guillem
> 
> subtitle: fix a potential memory leak
> 
> Fixes the Coverity defect 403210.
> 
> Breaking the switch case will end up freeing psz_orig and continue the
> loop.
> 
> Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> 
> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e96860acd9993f7409d335018987af73ecc3d947
> ---
> 
>  modules/demux/subtitle.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
> index 7ef29744f1..cfbe106d1f 100644
> --- a/modules/demux/subtitle.c
> +++ b/modules/demux/subtitle.c
> @@ -1884,7 +1884,7 @@ static int ParseJSS( vlc_object_t *p_obj,
> subs_properties_t *p_props,
>              case 'S':
>                   shift = isalpha( (unsigned char)psz_text[2] ) ? 6 : 2 ;
>                   if ( shift > line_length )
> -                     continue;
> +                     break;
>  
>                   if( sscanf( &psz_text[shift], "%d", &h ) )
>                   {
> @@ -1923,7 +1923,7 @@ static int ParseJSS( vlc_object_t *p_obj,
> subs_properties_t *p_props,
>              case 'T':
>                  shift = isalpha( (unsigned char)psz_text[2] ) ? 8 : 2 ;
>                  if ( shift > line_length )
> -                    continue;
> +                    break;
>  
>                  sscanf( &psz_text[shift], "%d",
>                  &p_props->jss.i_time_resolution );
>                  break;
> 
> _______________________________________________
> vlc-commits mailing list
> vlc-commits at videolan.org
> https://mailman.videolan.org/listinfo/vlc-commits


-- 
Jean-Baptiste Kempf -  President
+33 672 704 734


More information about the vlc-devel mailing list