[FFmpeg-devel] [PATCH] lavu/base64: add AV_BASE64_DECODE_SIZE() macro

Stefano Sabatini stefasab at gmail.com
Sat Apr 2 16:40:57 CEST 2016


On date Tuesday 2016-03-29 23:43:14 +0200, Michael Niedermayer encoded:
> On Tue, Mar 29, 2016 at 12:39:23PM +0200, Stefano Sabatini wrote:
> > This is consistent with the AV_BASE64_SIZE macro and avoids the literal
> > use of constants in the code.
> > 
> > TODO: update APIchanges and bump minor.
> > ---
> >  libavutil/base64.h | 9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
[...]
> >  /**
> > + * Calculate the output size in bytes needed to decode a base64 string
> > + * with lenght x to a data buffer.
> > + */
> > +#define AV_BASE64_DECODE_SIZE(x) ((x) * 3 / 4)
> 
> 3LL otherwise it could overflow
> 
> LGTM

Fixed and applied, thanks.
-- 
FFmpeg = Fundamental Faithful Mythic Pacific Evil Genius


More information about the ffmpeg-devel mailing list