Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
e435beb1
Commit
e435beb1
authored
Dec 15, 2016
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypto: consistently use size_t as type for length parameters
size_t is the correct type to use for sizes.
parent
f1af37b5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
4 deletions
+34
-4
APIchanges
doc/APIchanges
+4
-0
md5.c
libavutil/md5.c
+8
-0
md5.h
libavutil/md5.h
+7
-1
sha.c
libavutil/sha.c
+5
-1
sha.h
libavutil/sha.h
+7
-2
version.h
libavutil/version.h
+3
-0
No files found.
doc/APIchanges
View file @
e435beb1
...
...
@@ -13,6 +13,10 @@ libavutil: 2015-08-28
API changes, most recent first:
2016-xx-xx - xxxxxxx
Change av_sha_update() and av_md5_sum()/av_md5_update() length
parameter type to size_t at next major bump.
2016-xx-xx - xxxxxxx - lavc 57.29.0 - avcodec.h
Add AV_PKT_DATA_SPHERICAL packet side data to export AVSphericalMapping
information from containers.
...
...
libavutil/md5.c
View file @
e435beb1
...
...
@@ -146,7 +146,11 @@ void av_md5_init(AVMD5 *ctx)
ctx
->
ABCD
[
3
]
=
0x67452301
;
}
#if FF_API_CRYPTO_SIZE_T
void
av_md5_update
(
AVMD5
*
ctx
,
const
uint8_t
*
src
,
const
int
len
)
#else
void
av_md5_update
(
AVMD5
*
ctx
,
const
uint8_t
*
src
,
size_t
len
)
#endif
{
int
i
,
j
;
...
...
@@ -177,7 +181,11 @@ void av_md5_final(AVMD5 *ctx, uint8_t *dst)
AV_WL32
(
dst
+
4
*
i
,
ctx
->
ABCD
[
3
-
i
]);
}
#if FF_API_CRYPTO_SIZE_T
void
av_md5_sum
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
const
int
len
)
#else
void
av_md5_sum
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
size_t
len
)
#endif
{
AVMD5
ctx
;
...
...
libavutil/md5.h
View file @
e435beb1
...
...
@@ -21,6 +21,7 @@
#ifndef AVUTIL_MD5_H
#define AVUTIL_MD5_H
#include <stddef.h>
#include <stdint.h>
#include "attributes.h"
...
...
@@ -36,9 +37,14 @@ struct AVMD5;
struct
AVMD5
*
av_md5_alloc
(
void
);
void
av_md5_init
(
struct
AVMD5
*
ctx
);
void
av_md5_update
(
struct
AVMD5
*
ctx
,
const
uint8_t
*
src
,
const
int
len
);
void
av_md5_final
(
struct
AVMD5
*
ctx
,
uint8_t
*
dst
);
#if FF_API_CRYPTO_SIZE_T
void
av_md5_update
(
struct
AVMD5
*
ctx
,
const
uint8_t
*
src
,
const
int
len
);
void
av_md5_sum
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
const
int
len
);
#else
void
av_md5_update
(
struct
AVMD5
*
ctx
,
const
uint8_t
*
src
,
size_t
len
);
void
av_md5_sum
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
size_t
len
);
#endif
/**
* @}
...
...
libavutil/sha.c
View file @
e435beb1
...
...
@@ -290,7 +290,11 @@ av_cold int av_sha_init(AVSHA *ctx, int bits)
return
0
;
}
void
av_sha_update
(
AVSHA
*
ctx
,
const
uint8_t
*
data
,
unsigned
int
len
)
#if FF_API_CRYPTO_SIZE_T
void
av_sha_update
(
struct
AVSHA
*
ctx
,
const
uint8_t
*
data
,
unsigned
int
len
)
#else
void
av_sha_update
(
struct
AVSHA
*
ctx
,
const
uint8_t
*
data
,
size_t
len
)
#endif
{
unsigned
int
i
,
j
;
...
...
libavutil/sha.h
View file @
e435beb1
...
...
@@ -21,6 +21,7 @@
#ifndef AVUTIL_SHA_H
#define AVUTIL_SHA_H
#include <stddef.h>
#include <stdint.h>
#include "attributes.h"
...
...
@@ -51,11 +52,15 @@ int av_sha_init(struct AVSHA* context, int bits);
/**
* Update hash value.
*
* @param c
ontext
hash function context
* @param c
tx
hash function context
* @param data input data to update hash with
* @param len input data length
*/
void
av_sha_update
(
struct
AVSHA
*
context
,
const
uint8_t
*
data
,
unsigned
int
len
);
#if FF_API_CRYPTO_SIZE_T
void
av_sha_update
(
struct
AVSHA
*
ctx
,
const
uint8_t
*
data
,
unsigned
int
len
);
#else
void
av_sha_update
(
struct
AVSHA
*
ctx
,
const
uint8_t
*
data
,
size_t
len
);
#endif
/**
* Finish hashing and output digest value.
...
...
libavutil/version.h
View file @
e435beb1
...
...
@@ -105,6 +105,9 @@
#ifndef FF_API_PKT_PTS
#define FF_API_PKT_PTS (LIBAVUTIL_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_CRYPTO_SIZE_T
#define FF_API_CRYPTO_SIZE_T (LIBAVUTIL_VERSION_MAJOR < 56)
#endif
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment