[vlc-commits] asx: remove useless test
Pierre Lamot
git at videolan.org
Wed Dec 13 09:29:59 CET 2017
vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Mon Dec 11 10:22:45 2017 +0100| [cb7514099f2f45f45c409674a6a00df9833d8523] | committer: Jean-Baptiste Kempf
asx: remove useless test
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cb7514099f2f45f45c409674a6a00df9833d8523
---
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 0c0614cec7..c4d7170013 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