Commit 82497a6e authored by michael's avatar michael

buffer overflow in sdp_probe() fix by (Gildas Bazin )gbazin altern org)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@4049 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 89598f41
...@@ -1174,17 +1174,16 @@ AVInputFormat rtsp_demux = { ...@@ -1174,17 +1174,16 @@ AVInputFormat rtsp_demux = {
static int sdp_probe(AVProbeData *p1) static int sdp_probe(AVProbeData *p1)
{ {
const char *p; const char *p = p1->buf, *p_end = p1->buf + p1->buf_size;
/* we look for a line beginning "c=IN IP4" */ /* we look for a line beginning "c=IN IP4" */
p = p1->buf; while (p < p_end && *p != '\0') {
while (*p != '\0') { if (p + sizeof("c=IN IP4") - 1 < p_end && strstart(p, "c=IN IP4", NULL))
if (strstart(p, "c=IN IP4", NULL))
return AVPROBE_SCORE_MAX / 2; return AVPROBE_SCORE_MAX / 2;
p = strchr(p, '\n');
if (!p) while(p < p_end - 1 && *p != '\n') p++;
if (++p >= p_end)
break; break;
p++;
if (*p == '\r') if (*p == '\r')
p++; p++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment