Commit 24e7e023 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/crypto: Use av_memdup()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 00d4013d
...@@ -91,10 +91,9 @@ static int set_aes_arg(CryptoContext *c, uint8_t **buf, int *buf_len, ...@@ -91,10 +91,9 @@ static int set_aes_arg(CryptoContext *c, uint8_t **buf, int *buf_len,
desc, default_buf_len, BLOCKSIZE); desc, default_buf_len, BLOCKSIZE);
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
*buf = av_malloc(default_buf_len); *buf = av_memdup(default_buf, default_buf_len);
if (!*buf) if (!*buf)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
memcpy(*buf, default_buf, default_buf_len);
*buf_len = default_buf_len; *buf_len = default_buf_len;
} else if (*buf_len != BLOCKSIZE) { } else if (*buf_len != BLOCKSIZE) {
av_log(c, AV_LOG_ERROR, av_log(c, AV_LOG_ERROR,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment