[vlc-devel] [PATCH] M3u & pls demux: Check the size of each file line to prevent flooding the playlist.

Adrien Maglo magsoft at videolan.org
Thu Apr 25 00:38:01 CEST 2013


Le 24/04/2013 18:28, Rémi Denis-Courmont a écrit :
> Le mercredi 24 avril 2013 14:51:56, Adrien Maglo a écrit :
>> On 24/04/2013 13:40, Rémi Denis-Courmont wrote:
>>> On Wed, 24 Apr 2013 13:30:23 +0200, Adrien Maglo <magsoft at videolan.org>
>>>
>>> wrote:
>>>> Here is a new version of the patch with 4096 as the maximum line size.
>>>
>>> Well no. Not only does this fail to address a number of other parsers,
>>> but VLC still tries to allocate a huge memory block to read the URL. So
>>> AFAIK the bug is not at all fixed.
>>
>> The size of the allocated buffer is already limited in the
>> stream_ReadLine() function to STREAM_LINE_MAX = 2048*100
>> (src/input/stream.c).
>> This threshold is however still too large to output correctly the media
>> path, or maybe more generally transmit it to the playlist.
>
> Why?
>
> Performance problem aside, an URL of 200kiB should not be a problem. If it is,
> then something needs fixing anyway. That is most certainly not the native
> playlist demuxer.

An URL of 200 kB seems indeed to be only a problem for the logging system.

> By the way, while most do, not all item URLs come directly or indirectly from
> stream_ReadLine().

So an acceptable patch would be to just limit the length of the media 
path and name output in the logs?


-- 
MagSoft



More information about the vlc-devel mailing list