# HG changeset patch # User reimar # Date 1119441536 0 # Node ID 06a9914af502e6146139c24e8aefa1f402d53093 # Parent 5a39a40aa7023d9f385d7583f0886161af01f5cd fix illegal memory accesses diff -r 5a39a40aa702 -r 06a9914af502 libmpdemux/realrtsp/rtsp.c --- a/libmpdemux/realrtsp/rtsp.c Wed Jun 22 09:39:27 2005 +0000 +++ b/libmpdemux/realrtsp/rtsp.c Wed Jun 22 11:58:56 2005 +0000 @@ -272,10 +272,11 @@ static char *rtsp_get(rtsp_t *s) { - int n=0; + int n=1; char *buffer = malloc(BUF_SIZE); char *string = NULL; + read_stream(s->s, buffer, 1); while (ns, &(buffer[n]), 1); if ((buffer[n-1]==0x0d)&&(buffer[n]==0x0a)) break; diff -r 5a39a40aa702 -r 06a9914af502 libmpdemux/realrtsp/sdpplin.c --- a/libmpdemux/realrtsp/sdpplin.c Wed Jun 22 09:39:27 2005 +0000 +++ b/libmpdemux/realrtsp/sdpplin.c Wed Jun 22 11:58:56 2005 +0000 @@ -84,12 +84,12 @@ out[k++] = (b[2] << 6) | b[3]; i = a[2] == '=' ? 1 : (a[3] == '=' ? 2 : 3); if (i < 3) { - out[k]=0; + out[k - 1]=0; *size=k; return out; } } - out[k]=0; + out[k - 1]=0; *size=k; return out; }