[FFmpeg-devel] [PATCH] aes: AVAES.round_key should have space for 16 4x4 arrays, not 15

Reimar Döffinger Reimar.Doeffinger
Wed Jul 18 11:20:02 CEST 2007


Hello,
On Wed, Jul 18, 2007 at 09:20:01AM +0100, Andy Parkins wrote:
> On Wednesday 2007 July 18, Andy Parkins wrote:
> 
> > This patch changes the round_key declaration to
> >
> >  round_key[16][4][4];
> 
> I've just found revision 7471 which seems to suggest that this was done on 
> purpose.
> 
> That would make this patch redundant.  Please excuse the noise, and drop the 
> patch.

I suggest attached patch instead which documents this behaviour.

Greetings,
Reimar D?ffinger
-------------- next part --------------
diff --git a/libavutil/aes.c b/libavutil/aes.c
index dc37162..c538521 100644
--- a/libavutil/aes.c
+++ b/libavutil/aes.c
@@ -24,6 +24,8 @@
 #include "aes.h"
 
 typedef struct AVAES{
+    // Note: round_key[16] is accessed in the init code, but this only
+    // overwrites state, which does not matter (see also r7471).
     uint8_t round_key[15][4][4];
     uint8_t state[2][4][4];
     int rounds;



More information about the ffmpeg-devel mailing list