diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-01-14 09:25:52 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-01-14 09:25:52 +0000 |
commit | eade86e2f5f5f267633583cab439b3b468b6a700 (patch) | |
tree | 4528d971d9a581ec30e8e2a7740a198008e3d044 /libavutil/aes.c | |
parent | 2c3427eb2a37818e7792e3530537e6cecc7defb5 (diff) | |
download | ffmpeg-eade86e2f5f5f267633583cab439b3b468b6a700.tar.gz |
memleak
Originally committed as revision 7462 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/aes.c')
-rw-r--r-- | libavutil/aes.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavutil/aes.c b/libavutil/aes.c index 07485167b8..7dc4bad5ca 100644 --- a/libavutil/aes.c +++ b/libavutil/aes.c @@ -105,7 +105,7 @@ void av_aes_encrypt(AVAES *a){ // this is based on the reference AES code by Paulo Barreto and Vincent Rijmen AVAES *av_aes_init(uint8_t *key, int keyBits) { - AVAES *a= av_malloc(sizeof(AVAES)); + AVAES *a; int i, j, t, rconpointer = 0; uint8_t tk[8][4]; int KC= keyBits/32; @@ -131,11 +131,12 @@ AVAES *av_aes_init(uint8_t *key, int keyBits) { } } - a->rounds= ROUNDS; - if(keyBits!=128 && keyBits!=192 && keyBits!=256) return NULL; + a= av_malloc(sizeof(AVAES)); + a->rounds= ROUNDS; + memcpy(tk, key, KC*4); for(t= 0; t < (ROUNDS+1)*4; ) { |