[vlc-commits] asx: remove useless test
Pierre Lamot
git at videolan.org
Wed Dec 13 11:15:32 CET 2017
vlc/vlc-3.0 | branch: master | Pierre Lamot <pierre at videolabs.io> | Mon Dec 11 10:22:45 2017 +0100| [4390f08b992dea89010f93aeaa5d268d0e7b134e] | committer: Hugo Beauzée-Luyssen
asx: remove useless test
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit cb7514099f2f45f45c409674a6a00df9833d8523)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=4390f08b992dea89010f93aeaa5d268d0e7b134e
---
modules/demux/playlist/asx.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/modules/demux/playlist/asx.c b/modules/demux/playlist/asx.c
index aa71b1b0c4..ffb0d63bab 100644
--- a/modules/demux/playlist/asx.c
+++ b/modules/demux/playlist/asx.c
@@ -356,16 +356,17 @@ end:
/// this looks for patterns like &name; &#DEC; or &#xHEX;
static bool isXmlEncoded(const char* psz_str)
{
+ assert( psz_str != NULL );
//look for special characters
if( strpbrk(psz_str, "<>'\"") != NULL )
return false;
bool is_escaped = false;
- while (psz_str != NULL)
+ while( true )
{
const char* psz_amp = strchr(psz_str, '&');
if( psz_amp == NULL )
- return is_escaped;
+ break;
const char* psz_end = strchr(psz_amp, ';');
if( psz_end == NULL )
return false;
@@ -414,6 +415,9 @@ static void memstream_puts_xmlencoded(struct vlc_memstream* p_stream, const char
else
psz_tmp = strndup( psz_begin, psz_end - psz_begin );
+ if ( psz_tmp == NULL )
+ return;
+
if( isXmlEncoded( psz_tmp ) )
vlc_memstream_puts( p_stream, psz_tmp );
else
More information about the vlc-commits
mailing list