[vlc-devel] [PATCH 3/4] asx: don't fail if stream size is unknowned

Pierre Lamot pierre at videolabs.io
Wed Dec 6 16:06:54 CET 2017


---
 modules/demux/playlist/asx.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/demux/playlist/asx.c b/modules/demux/playlist/asx.c
index 3b7da94e55..30c0d53389 100644
--- a/modules/demux/playlist/asx.c
+++ b/modules/demux/playlist/asx.c
@@ -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 ) )
-- 
2.14.1



More information about the vlc-devel mailing list