[FFmpeg-devel] tools: crypto_bench: Added support for Twofish

Nicolas George george at nsup.org
Sat Feb 14 11:57:30 CET 2015


Le sextidi 26 pluviôse, an CCXXIII, Michael Niedermayer a écrit :
> > +static void run_lavu_twofish(uint8_t *output,
> > +                              const uint8_t *input, unsigned size)
> > +{
> > +    static struct AVTWOFISH *twofish;
> > +    if (!twofish && !(twofish = av_twofish_alloc()))
> the memory should be freed somewhere

All the other benchmarks already work like that, without freeing.

> otherwise memory debuggers would likely display a warning about a
> memleak (which could make it harder to see real problems)

The variable is declared static, so the pointed memory is considered still
reachable even at the end of the program. If a memory debugger is not
capable of seeing that, it is not worth using. The same happens for the
default mutex and co.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150214/0b94e6c7/attachment.asc>


More information about the ffmpeg-devel mailing list