Commit 42e7e629 authored by michael's avatar michael

memleak


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@7462 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 9cbbf0fe
...@@ -105,7 +105,7 @@ void av_aes_encrypt(AVAES *a){ ...@@ -105,7 +105,7 @@ void av_aes_encrypt(AVAES *a){
// this is based on the reference AES code by Paulo Barreto and Vincent Rijmen // this is based on the reference AES code by Paulo Barreto and Vincent Rijmen
AVAES *av_aes_init(uint8_t *key, int keyBits) { AVAES *av_aes_init(uint8_t *key, int keyBits) {
AVAES *a= av_malloc(sizeof(AVAES)); AVAES *a;
int i, j, t, rconpointer = 0; int i, j, t, rconpointer = 0;
uint8_t tk[8][4]; uint8_t tk[8][4];
int KC= keyBits/32; int KC= keyBits/32;
...@@ -131,11 +131,12 @@ AVAES *av_aes_init(uint8_t *key, int keyBits) { ...@@ -131,11 +131,12 @@ AVAES *av_aes_init(uint8_t *key, int keyBits) {
} }
} }
a->rounds= ROUNDS;
if(keyBits!=128 && keyBits!=192 && keyBits!=256) if(keyBits!=128 && keyBits!=192 && keyBits!=256)
return NULL; return NULL;
a= av_malloc(sizeof(AVAES));
a->rounds= ROUNDS;
memcpy(tk, key, KC*4); memcpy(tk, key, KC*4);
for(t= 0; t < (ROUNDS+1)*4; ) { for(t= 0; t < (ROUNDS+1)*4; ) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment