[vlc-commits] asx: don't fail if stream size is unknown

Pierre Lamot git at videolan.org
Sun Dec 10 02:42:21 CET 2017


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed Dec  6 16:06:54 2017 +0100| [ba71ea34edefa10019ec3d8b4dfc040bdad5b0f9] | committer: Jean-Baptiste Kempf

asx: don't fail if stream size is unknown

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ba71ea34edefa10019ec3d8b4dfc040bdad5b0f9
---

 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 96e126e563..c5c62e6662 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 ) )



More information about the vlc-commits mailing list