[vlc-devel] [PATCH 2/2] sout: description: make the ownership of es_format clear

Zhao Zhili quinkblack at foxmail.com
Tue Oct 2 08:34:20 CEST 2018


On 10/2/18 2:59 AM, Rémi Denis-Courmont wrote:
> Le maanantaina 1. lokakuuta 2018, 21.44.11 EEST Francois Cartegnie a écrit :
>> Le 01/10/2018 à 13:11, Zhao Zhili a écrit :
>>>> Only the NOTE is incorrect and the Del() must free the opaque, being
>>>> here a fmt copy.
>>>
>>> Del() is called during input_Close(), but those es_format associated with
>>> sout-description-data are used after input_Close(). So if there is a
>>> single copy and Del() free those es_format, it leads to use-after-free.
>>> If you think two copies are not right, any other suggestion?
>>>
>>> vlm.c:
>>>                  var_Create( p_input, "sout-description-data",
>>>                  VLC_VAR_ADDRESS );
>>>                  var_SetAddress( p_input, "sout-description-data", &data );
>>>                  
>>>                  if( !input_Start( p_input ) )
>>>                  
>>>                      vlc_sem_wait( &sem_preparse );
>>>                  
>>>                  var_DelCallback( p_input, "intf-event",
>>>                  InputEventPreparse,
>>>                  
>>>                                   &preparse );
>>>                  
>>>                  input_Stop( p_input );
>>>                  input_Close( p_input );
>>
>> Sounds like a hackish module :/
> 
> Yes, it's a horrible hack that only exists underneath the other horrible hack
> known as the vod server module.
> 
> But it's always been like, and given how nobody cares about the VoD
> functionality, it might not be worth fixing. (I'd rather bite the bullet and
> remove altogether TBH.)
> 

I don't know much usecases about it and just poking around. Standard 
HTTP server and sftp are both better VOD methods in my daily usage. I'd 
like to see some roadmaps about streaming.



More information about the vlc-devel mailing list