[vlc-devel] [PATCH] vlc 2.1.0 access_output/livehttp.c uninitialized data fix

Ilkka Ollakka ileoo at videolan.org
Thu Oct 3 13:19:45 CEST 2013


On Tue, Oct 01, 2013 at 11:11:41PM +0000, LANGLOIS Olivier PIS -EXT wrote:
> because not all sout_access_out_sys_t data members are initialized, f_seglen ended up being garbage and resulted to a very long duration for the first segment in the m3u8 index file:

Hi,

How big is that first segment in megabytes? I think this bug could more
likely from from line 923 for not checking if p_buffer->i_dts is not
VLC_TS_INVALID (if it is, we get funny opendts and length is huge even
if file itself would be really small).

> #EXTINF:308800210012931175733052571648.00,
> http://cwsla1gctd/hls/mystream-00000001.ts
> #EXTINF:13.25,
> http://cwsla1gctd/hls/mystream-00000002.ts
> #EXTINF:14.03,
> http://cwsla1gctd/hls/mystream-00000003.ts
> #EXT-X-ENDLIST

> This in turn made the old segment deletion impossible because

> duration >= (first->f_seglength + (float)p_sys->i_seglen)

> in isFirstItemRemovable was always false.

> Signed-off-by: Olivier Langlois olivier at trillion01.com

> --- vlc-2.1.0/modules/access_output/livehttp.c.orig     2013-10-01 18:43:35.058487310 -0400
> +++ vlc-2.1.0/modules/access_output/livehttp.c  2013-10-01 18:51:11.393391604 -0400
> @@ -218,7 +218,7 @@ static int Open( vlc_object_t *p_this )
>          return VLC_EGENERIC;
>      }

> -    if( unlikely( !( p_sys = malloc ( sizeof( *p_sys ) ) ) ) )
> +    if( unlikely( !( p_sys = calloc ( 1, sizeof( *p_sys ) ) ) ) )
>          return VLC_ENOMEM;

>      p_sys->i_seglen = var_GetInteger( p_access, SOUT_CFG_PREFIX "seglen" );
> @@ -844,12 +844,10 @@ static ssize_t openNextFile( sout_access
>      uint32_t i_newseg = p_sys->i_segment + 1;

>      /* Create segment and fill it info that we can (everything excluding duration */
> -    output_segment_t *segment = (output_segment_t*)malloc(sizeof(output_segment_t));
> +    output_segment_t *segment = (output_segment_t*)calloc(1, sizeof(output_segment_t));
>      if( unlikely( !segment ) )
>          return -1;

> -    memset( segment, 0 , sizeof( output_segment_t ) );
> -
>      segment->i_segment_number = i_newseg;
>      segment->psz_filename = formatSegmentPath( p_access->psz_path, i_newseg, true );
>      char *psz_idxFormat = p_sys->psz_indexUrl ? p_sys->psz_indexUrl : p_access->psz_path;



> ________________________________
> CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose or store or copy the information in any medium.
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


-- 
Ilkka Ollakka
F:	When into a room I plunge, I
	Sometimes find some VIOLET FUNGI.
	Then I linger, darkly brooding
	On the poison they're exuding.
		-- The Roguelet's ABC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20131003/b1f47dd0/attachment.sig>


More information about the vlc-devel mailing list