From 24e7e0237b6eb95a649dc62bd70817a12c6c6ea6 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 2 Dec 2014 01:47:49 +0100 Subject: [PATCH] avformat/crypto: Use av_memdup() Signed-off-by: Michael Niedermayer --- libavformat/crypto.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavformat/crypto.c b/libavformat/crypto.c index f3a85c7f0f..c1754b0b11 100644 --- a/libavformat/crypto.c +++ b/libavformat/crypto.c @@ -91,10 +91,9 @@ static int set_aes_arg(CryptoContext *c, uint8_t **buf, int *buf_len, desc, default_buf_len, BLOCKSIZE); return AVERROR(EINVAL); } - *buf = av_malloc(default_buf_len); + *buf = av_memdup(default_buf, default_buf_len); if (!*buf) return AVERROR(ENOMEM); - memcpy(*buf, default_buf, default_buf_len); *buf_len = default_buf_len; } else if (*buf_len != BLOCKSIZE) { av_log(c, AV_LOG_ERROR,