diff --git a/libavutil/base64.c b/libavutil/base64.c index 5a7ab4c977339803d50a794d0fbd590c4db38ecd..ef9bfc95dd3a2a73333cf211c73a9da9eb432eef 100644 --- a/libavutil/base64.c +++ b/libavutil/base64.c @@ -93,8 +93,10 @@ char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size) do { *dst++ = b64[(i_bits << 6 >> i_shift) & 0x3f]; i_shift -= 6; - } while (i_shift > 6 || (bytes_remaining == 0 && i_shift > 0)); + } while (i_shift > 6); } + if (i_shift > 0) + *dst++ = b64[(i_bits << 6 >> i_shift) & 0x3f]; while ((dst - ret) & 3) *dst++ = '='; *dst = '\0';