diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-06-22 11:58:56 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-06-22 11:58:56 +0000 |
commit | b3946c3bb1b49ea9f9d639251ab274c387763832 (patch) | |
tree | 51d3b50e3d9149e1adc6ce5841d0aa989b3a0894 | |
parent | eec8ec8a5c5a7272fb44d1e9ddc9fc3ef0d6dc50 (diff) | |
download | mpv-b3946c3bb1b49ea9f9d639251ab274c387763832.tar.bz2 mpv-b3946c3bb1b49ea9f9d639251ab274c387763832.tar.xz |
fix illegal memory accesses
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15798 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpdemux/realrtsp/rtsp.c | 3 | ||||
-rw-r--r-- | libmpdemux/realrtsp/sdpplin.c | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/libmpdemux/realrtsp/rtsp.c b/libmpdemux/realrtsp/rtsp.c index 708e8729aa..6247ca1baa 100644 --- a/libmpdemux/realrtsp/rtsp.c +++ b/libmpdemux/realrtsp/rtsp.c @@ -272,10 +272,11 @@ static void hexdump (char *buf, int length) { 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 (n<BUF_SIZE) { read_stream(s->s, &(buffer[n]), 1); if ((buffer[n-1]==0x0d)&&(buffer[n]==0x0a)) break; diff --git a/libmpdemux/realrtsp/sdpplin.c b/libmpdemux/realrtsp/sdpplin.c index 229f4a0e68..ff9246a9e7 100644 --- a/libmpdemux/realrtsp/sdpplin.c +++ b/libmpdemux/realrtsp/sdpplin.c @@ -84,12 +84,12 @@ static char *b64_decode(const char *in, char *out, int *size) 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; } |