[SCM] libav/experimental: strchr(string, '\0') returns non-NULL, and is thus not suited for use in redir_isspace(char) to check if '\0' is a space or not. Therefore, we now use memchr(), since then we can give the length of the string (i.e. the length excluding the terminating '\0'). Fixes issue 919, see also the follow-ups in the "[PATCH] rtsp.c small cleanups" mailinglist thread.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:42:29 UTC 2013


The following commit has been merged in the experimental branch:
commit da1e126e0db3eda68153bb8130947adba8236034
Author: Ronald S. Bultje <rsbultje at gmail.com>
Date:   Tue Mar 24 03:24:59 2009 +0000

    strchr(string, '\0') returns non-NULL, and is thus not suited for use in
    redir_isspace(char) to check if '\0' is a space or not. Therefore, we now
    use memchr(), since then we can give the length of the string (i.e. the
    length excluding the terminating '\0'). Fixes issue 919, see also the
    follow-ups in the "[PATCH] rtsp.c small cleanups" mailinglist thread.
    
    Originally committed as revision 18177 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index c9e60dd..758314f 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -55,7 +55,9 @@ static int rtsp_probe(AVProbeData *p)
 }
 
 #define SPACE_CHARS " \t\r\n"
-#define redir_isspace(c) strchr(SPACE_CHARS, c)
+/* we use memchr() instead of strchr() here because strchr() will return
+ * the terminating '\0' of SPACE_CHARS instead of NULL if c is '\0'. */
+#define redir_isspace(c) memchr(SPACE_CHARS, c, 4)
 static void skip_spaces(const char **pp)
 {
     const char *p;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list