Commit ba71ea34 authored by Pierre Lamot's avatar Pierre Lamot Committed by Jean-Baptiste Kempf

asx: don't fail if stream size is unknown

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent ff3ffa91
......@@ -356,11 +356,13 @@ static stream_t* UTF8Stream( stream_t *p_demux )
{
stream_t *s = p_demux->s;
uint64_t streamSize;
static const size_t maxsize = 1024 * 1024;
if( vlc_stream_GetSize( s, &streamSize ) != VLC_SUCCESS)
streamSize = maxsize;
if (vlc_stream_GetSize( s, &streamSize ) != VLC_SUCCESS)
return NULL;
// Don't attempt to convert/store huge streams
if( streamSize > 1024 * 1024 )
if( streamSize > maxsize )
return NULL;
char* psz_source = malloc( streamSize + 1 * sizeof( *psz_source ) );
if ( unlikely( psz_source == NULL ) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment