[FFmpeg-soc] [soc]: r5189 - in concat/libavformat: playlist.c pls.c xspf.c

gkovacs subversion at mplayerhq.hu
Thu Aug 20 13:33:59 CEST 2009


Author: gkovacs
Date: Thu Aug 20 13:33:59 2009
New Revision: 5189

Log:
use memcmp rather than strncmp for comparing buffers

Modified:
   concat/libavformat/playlist.c
   concat/libavformat/pls.c
   concat/libavformat/xspf.c

Modified: concat/libavformat/playlist.c
==============================================================================
--- concat/libavformat/playlist.c	Thu Aug 20 11:57:33 2009	(r5188)
+++ concat/libavformat/playlist.c	Thu Aug 20 13:33:59 2009	(r5189)
@@ -240,3 +240,4 @@ int ff_playlist_streams_offset_from_play
         total += ctx->nb_streams_list[i++];
     return total;
 }
+

Modified: concat/libavformat/pls.c
==============================================================================
--- concat/libavformat/pls.c	Thu Aug 20 11:57:33 2009	(r5188)
+++ concat/libavformat/pls.c	Thu Aug 20 13:33:59 2009	(r5189)
@@ -60,7 +60,7 @@ static int pls_list_files(ByteIOContext 
             s[2] = s[3];
             s[3] = s[4];
             s[4] = c;
-            if (!strncmp(s, t, 5))
+            if (!memcmp(s, t, 5))
                 state = 1;
         } else if (state == 1) {
             if (c == '=')

Modified: concat/libavformat/xspf.c
==============================================================================
--- concat/libavformat/xspf.c	Thu Aug 20 11:57:33 2009	(r5188)
+++ concat/libavformat/xspf.c	Thu Aug 20 13:33:59 2009	(r5189)
@@ -54,7 +54,7 @@ static int xspf_probe(AVProbeData *p)
             s[2] = s[3];
             s[3] = s[4];
             s[4] = c;
-            if (!strncmp(s, t, 5))
+            if (!memcmp(s, t, 5))
                 fxml = 1;
         }
         if (!ftag) {
@@ -67,7 +67,7 @@ static int xspf_probe(AVProbeData *p)
             u[6] = u[7];
             u[7] = u[8];
             u[8] = c;
-            if (!strncmp(u, v, 9))
+            if (!memcmp(u, v, 9))
                 ftag = 1;
         }
     }
@@ -104,8 +104,7 @@ static int xspf_list_files(ByteIOContext
             s[7] = s[8];
             s[8] = s[9];
             s[9] = c;
-            if (s[0] == t[0] && s[1] == t[1] && s[2] == t[2] && s[3] == t[3] && s[4] == t[4] &&
-                s[5] == t[5] && s[6] == t[6] && s[7] == t[7] && s[8] == t[8] && s[9] == t[9])
+            if (!memcmp(s, t, 10))
                 state = 1;
         } else {
             if (c == '<') {


More information about the FFmpeg-soc mailing list