diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2012-09-08 16:31:33 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-09-08 19:30:10 +0400 |
commit | 9ab538e31f8621ea7400a1d8bdf9d6091aa3dedf (patch) | |
tree | 5e5bb87fbadc0caf9e5382d49eff70f03be014f0 /libavutil | |
parent | b86e18fe4626459de3a6d9ee1068411dcec7dc4e (diff) |
random_seed: Replace a VLA with a normal array
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/random_seed.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c index e60ace0090..d1a1fa645a 100644 --- a/libavutil/random_seed.c +++ b/libavutil/random_seed.c @@ -27,6 +27,7 @@ #include <math.h> #include <time.h> #include <string.h> +#include "avassert.h" #include "timer.h" #include "random_seed.h" #include "sha.h" @@ -55,7 +56,7 @@ static int read_random(uint32_t *dst, const char *file) static uint32_t get_generic_seed(void) { - uint8_t tmp[av_sha_size]; + uint8_t tmp[120]; struct AVSHA *sha = (void*)tmp; clock_t last_t = 0; static uint64_t i = 0; @@ -63,6 +64,8 @@ static uint32_t get_generic_seed(void) unsigned char digest[32]; uint64_t last_i = i; + av_assert0(sizeof(tmp) >= av_sha_size); + if(TEST){ memset(buffer, 0, sizeof(buffer)); last_i = i = 0; |