avformat/rtsp: Fix potential pointer overflow in sdp_probe()
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 16 Mar 2015 21:40:36 +0000 (22:40 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 16 Mar 2015 21:40:36 +0000 (22:40 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/rtsp.c

index 91128e1..14ac510 100644 (file)
@@ -2196,7 +2196,7 @@ static int sdp_probe(AVProbeData *p1)
 
     /* we look for a line beginning "c=IN IP" */
     while (p < p_end && *p != '\0') {
-        if (p + sizeof("c=IN IP") - 1 < p_end &&
+        if (sizeof("c=IN IP") - 1 < p_end - p &&
             av_strstart(p, "c=IN IP", NULL))
             return AVPROBE_SCORE_EXTENSION;