Revert fix v1.3, it breaks streams with cook audio (ex.

rtsp://mm4.rai.it/raitre/blob/ultimo/blob.rm)
Applied a different fix for the first buf[k] (ensure buf size is k+4)
The second buf[k] is safe, buf is at least 32 when the code is called


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15933 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
rtognimp 2005-07-06 21:37:38 +00:00
parent a65f9f76bf
commit 9f60836046
1 changed files with 3 additions and 3 deletions

View File

@ -80,18 +80,18 @@ static char *b64_decode(const char *in, char *out, int *size)
a[i] = (char) c;
b[i] = (char) dtable[c];
}
out = xbuffer_ensure_size(out, k+3);
out = xbuffer_ensure_size(out, k+4);
out[k++] = (b[0] << 2) | (b[1] >> 4);
out[k++] = (b[1] << 4) | (b[2] >> 2);
out[k++] = (b[2] << 6) | b[3];
i = a[2] == '=' ? 1 : (a[3] == '=' ? 2 : 3);
if (i < 3) {
out[k - 1]=0;
out[k]=0;
*size=k;
return out;
}
}
out[k - 1]=0;
out[k]=0;
*size=k;
return out;
}