[FFmpeg-cvslog] lavu/sha512: update length argument following sha+md5 changes

Clément Bœsch git at videolan.org
Fri May 5 14:23:43 EEST 2017


ffmpeg | branch: master | Clément Bœsch <cboesch at gopro.com> | Fri May  5 13:21:39 2017 +0200| [fcc4ed1efa1a7575dc45fe57ce552af331941469] | committer: Clément Bœsch

lavu/sha512: update length argument following sha+md5 changes

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

 doc/APIchanges     | 2 +-
 libavutil/sha512.c | 4 ++++
 libavutil/sha512.h | 5 +++++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index e8c08ca769..01c55a1ed0 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -16,7 +16,7 @@ libavutil:     2015-08-28
 API changes, most recent first:
 
 2017-xx-xx - xxxxxxxxxx
-  Change av_sha_update() and av_md5_sum()/av_md5_update() length
+  Change av_sha_update(), av_sha512_update() and av_md5_sum()/av_md5_update() length
   parameter type to size_t at next major bump.
 
 2017-05-05 - xxxxxxxxxx - lavc 57.94.100 - avcodec.h
diff --git a/libavutil/sha512.c b/libavutil/sha512.c
index 2c5da25591..6d092a7c5c 100644
--- a/libavutil/sha512.c
+++ b/libavutil/sha512.c
@@ -239,7 +239,11 @@ av_cold int av_sha512_init(AVSHA512 *ctx, int bits)
     return 0;
 }
 
+#if FF_API_CRYPTO_SIZE_T
 void av_sha512_update(AVSHA512* ctx, const uint8_t* data, unsigned int len)
+#else
+void av_sha512_update(AVSHA512* ctx, const uint8_t* data, size_t len)
+#endif
 {
     unsigned int i, j;
 
diff --git a/libavutil/sha512.h b/libavutil/sha512.h
index 5bac184cf3..bef714b41c 100644
--- a/libavutil/sha512.h
+++ b/libavutil/sha512.h
@@ -28,6 +28,7 @@
 #ifndef AVUTIL_SHA512_H
 #define AVUTIL_SHA512_H
 
+#include <stddef.h>
 #include <stdint.h>
 
 #include "attributes.h"
@@ -75,7 +76,11 @@ int av_sha512_init(struct AVSHA512* context, int bits);
  * @param data    input data to update hash with
  * @param len     input data length
  */
+#if FF_API_CRYPTO_SIZE_T
 void av_sha512_update(struct AVSHA512* context, const uint8_t* data, unsigned int len);
+#else
+void av_sha512_update(struct AVSHA512* context, const uint8_t* data, size_t len);
+#endif
 
 /**
  * Finish hashing and output digest value.



More information about the ffmpeg-cvslog mailing list