If you mean ceil(inlen * 4/3) + 1 (even if you use exact arithmetic), then you are passing too small a buffer and you will overflow. Maybe your “add padding” part fixes it? In any case, I think that the fact that this confusion is even possible proves my point.
You should not need to read the manpage of a function you are calling in order to determine whether you have passed a large enough buffer to avoid overflow.
Reading the manpage to get the function to not return an error would be a different story.
If you let untrusted input reach inlen and overflow that computation, you have already failed:
The caller shouldn't be responsible for enforcing preconditions of your function. They should just provide the input buffer, output buffer, their sizes and your implementation should verify whether it's safe to proceed.
In my case, if i write a public-facing API, i never trust the caller will do the correct thing, thus the caller must provide all the critical parameters, and i must validate all of them.
At the boundary where untrusted input becomes trusted. This is commonly known as the sanitisation/validation layer.