[FFmpeg-devel] [PATCH 1/4] blowfish: add av_blowfish_alloc()

Michael Niedermayer michael at niedermayer.cc
Fri Jul 31 22:40:42 CEST 2015


On Fri, Jul 31, 2015 at 02:18:07PM -0300, James Almer wrote:
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  doc/APIchanges       |  3 +++
>  libavutil/blowfish.c | 15 +++++++++++++++
>  libavutil/blowfish.h | 10 ++++++++++
>  libavutil/version.h  |  5 ++++-
>  4 files changed, 32 insertions(+), 1 deletion(-)
[...]
> @@ -30,12 +31,21 @@
>   * @{
>   */
>  
> +#if FF_API_CRYPTO_CONTEXT
>  #define AV_BF_ROUNDS 16
>  
>  typedef struct AVBlowfish {
>      uint32_t p[AV_BF_ROUNDS + 2];
>      uint32_t s[4][256];
>  } AVBlowfish;
> +#else
> +typedef struct AVBlowfish AVBlowfish;
> +#endif

Is it intended to remove all means to allocate the context on the
stack ?

this would avoid dealing with malloc/free and malloc failure handling
and could be a signifiant advantage also if any usecase is in a API
that lacks the possibility to fail, like maybe some crypto callbacks
with "void return"

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150731/a3860e24/attachment.sig>


More information about the ffmpeg-devel mailing list