Changeset a87063e35f7d36c9053951a0a58be5a61ffca082

Show
Ignore:
Timestamp:
11/02/07 21:37:19 (2 years ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1171226239 +0000
git-parent:

[65f5f148fff62fef60b0e96e1ecde3694b674caf]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1171226239 +0000
Message:

Fix SAP parser (again)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/services_discovery/sap.c

    r14fb31d ra87063e  
    394394    } 
    395395 
    396     if( p_sdp->mediac > 1 ) 
    397     { 
    398         goto error; 
    399     } 
    400  
    401396    if( ParseConnection( VLC_OBJECT( p_demux ), p_sdp ) ) 
    402397    { 
     
    707702 
    708703    if( p_sdp == NULL ) 
    709     { 
    710704        return VLC_EGENERIC; 
    711     } 
    712705 
    713706    /* Decide whether we should add a playlist item for this SDP */ 
    714707    /* Parse connection information (c= & m= ) */ 
    715708    if( ParseConnection( VLC_OBJECT(p_sd), p_sdp ) ) 
    716     { 
    717709        p_sdp->psz_uri = NULL; 
    718     } 
    719710 
    720711    /* Multi-media or no-parse -> pass to LIVE.COM */ 
    721     if( p_sdp->mediac > 1 || ( p_sdp->i_media_type != 14 && 
    722                                 p_sdp->i_media_type != 32 && 
    723                                 p_sdp->i_media_type != 33) || 
    724         p_sd->p_sys->b_parse == VLC_FALSE ) 
    725     { 
    726         if( p_sdp->psz_uri ) free( p_sdp->psz_uri ); 
    727         asprintf( &p_sdp->psz_uri, "sdp://%s", p_sdp->psz_sdp ); 
     712    if( ( p_sdp->i_media_type != 14 
     713       && p_sdp->i_media_type != 32 
     714       && p_sdp->i_media_type != 33) 
     715     || p_sd->p_sys->b_parse == VLC_FALSE ) 
     716    { 
     717        free( p_sdp->psz_uri ); 
     718        if (asprintf( &p_sdp->psz_uri, "sdp://%s", p_sdp->psz_sdp ) == -1) 
     719            p_sdp->psz_uri = NULL; 
    728720    } 
    729721 
     
    11871179                    goto error; 
    11881180                } 
    1189                 int port = atoi (data); 
     1181                int port = atoi (++data); 
    11901182                if (port <= 0 || port >= 65536) 
    11911183                { 
     
    12011193                    goto error; 
    12021194                } 
    1203                 m->fmt = strdup (data); 
     1195                m->fmt = strdup (++data); 
    12041196                if (m->fmt == NULL) 
    12051197                    goto error;