mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 02:20:56 +01:00
base64: simplify end handling in av_base64_encode()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
112bca91b0
commit
ea4da94895
1 changed files with 3 additions and 6 deletions
|
|
@ -99,14 +99,11 @@ char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size)
|
|||
i_bits = (i_bits << 8) + *in++;
|
||||
bytes_remaining--;
|
||||
i_shift += 8;
|
||||
|
||||
do {
|
||||
*dst++ = b64[(i_bits << 6 >> i_shift) & 0x3f];
|
||||
i_shift -= 6;
|
||||
} while (i_shift > 6);
|
||||
}
|
||||
if (i_shift > 0)
|
||||
while (i_shift > 0) {
|
||||
*dst++ = b64[(i_bits << 6 >> i_shift) & 0x3f];
|
||||
i_shift -= 6;
|
||||
}
|
||||
while ((dst - ret) & 3)
|
||||
*dst++ = '=';
|
||||
*dst = '\0';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue