[FFmpeg-cvslog] avformat/crypto: Use av_memdup()

Michael Niedermayer git at videolan.org
Tue Dec 2 02:02:15 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Dec  2 01:47:49 2014 +0100| [24e7e0237b6eb95a649dc62bd70817a12c6c6ea6] | committer: Michael Niedermayer

avformat/crypto: Use av_memdup()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=24e7e0237b6eb95a649dc62bd70817a12c6c6ea6
---

 libavformat/crypto.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavformat/crypto.c b/libavformat/crypto.c
index f3a85c7..c1754b0 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,



More information about the ffmpeg-cvslog mailing list