[vlc-commits] asx: don't fail if stream size is unknown
Pierre Lamot
git at videolan.org
Sun Dec 10 23:34:00 CET 2017
vlc/vlc-3.0 | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed Dec 6 16:06:54 2017 +0100| [a31042093c767d5202845d7c25c863c24d051db3] | committer: Jean-Baptiste Kempf
asx: don't fail if stream size is unknown
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit ba71ea34edefa10019ec3d8b4dfc040bdad5b0f9)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=a31042093c767d5202845d7c25c863c24d051db3
---
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 2a822dbdb5..6c33b79d8e 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->p_source;
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