]> git.sesse.net Git - vlc/commitdiff
Untested workarround for buggy asx files with an end of line char at the end of the...
authorAntoine Cellerier <dionoea@videolan.org>
Tue, 19 Jun 2007 16:30:02 +0000 (16:30 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Tue, 19 Jun 2007 16:30:02 +0000 (16:30 +0000)
modules/demux/playlist/asx.c

index a0060d2e503f2a756ceb78e79f0f9d3d2140e1a1..292025aeb066950e91245a4f281f0ad9b124f8c5 100644 (file)
@@ -591,6 +591,7 @@ static int Demux( demux_t *p_demux )
                         psz_backup = ++psz_parse;
                         if( ( psz_parse = strcasestr( psz_parse, "\"" ) ) )
                         {
+                            char *psz_tmp;
                             i_strlen = psz_parse-psz_backup;
                             if( i_strlen < 1 ) continue;
 
@@ -598,6 +599,13 @@ static int Demux( demux_t *p_demux )
                             psz_href = malloc( i_strlen*sizeof( char ) +1);
                             memcpy( psz_href, psz_backup, i_strlen );
                             psz_href[i_strlen] = '\0';
+                            psz_tmp = psz_href + (i_strlen-1);
+                            while( psz_tmp >= psz_href &&
+                                 ( *psz_tmp == '\r' || *psz_tmp == '\n' ) )
+                            {
+                                *psz_tmp = '\0';
+                                psz_tmp++;
+                            }
                         }
                         else continue;
                     }