aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-12-02 01:47:49 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-12-02 02:01:11 +0100
commit24e7e0237b6eb95a649dc62bd70817a12c6c6ea6 (patch)
tree317e39ff0c60026dd397a50bc379eabf4d76643e
parent00d4013d9f841c189a2f10dd05526ca40129b880 (diff)
downloadffmpeg-24e7e0237b6eb95a649dc62bd70817a12c6c6ea6.tar.gz
avformat/crypto: Use av_memdup()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/crypto.c3
1 files changed, 1 insertions, 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,