mirror of https://github.com/mpv-player/mpv
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:
parent
a65f9f76bf
commit
9f60836046
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue