[Ffmpeg-cvslog] r7462 - trunk/libavutil/aes.c

michael subversion
Sun Jan 14 10:25:53 CET 2007


Author: michael
Date: Sun Jan 14 10:25:52 2007
New Revision: 7462

Modified:
   trunk/libavutil/aes.c

Log:
memleak


Modified: trunk/libavutil/aes.c
==============================================================================
--- trunk/libavutil/aes.c	(original)
+++ trunk/libavutil/aes.c	Sun Jan 14 10:25:52 2007
@@ -105,7 +105,7 @@
 
 // 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 @@
         }
     }
 
-    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; ) {




More information about the ffmpeg-cvslog mailing list