[FFmpeg-devel] [PATCH] aes: fix array index out of bounds warnings

Michael Niedermayer michaelni
Sun Jul 4 22:29:43 CEST 2010


On Sun, Jul 04, 2010 at 12:24:19PM +0100, M?ns Rullg?rd wrote:
> Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
> 
> > On Sat, Jun 26, 2010 at 12:54:21AM +0100, Mans Rullgard wrote:
> >> ---
> >>  libavutil/aes.c |    4 ++--
> >>  1 files changed, 2 insertions(+), 2 deletions(-)
> >> 
> >> diff --git a/libavutil/aes.c b/libavutil/aes.c
> >> index d3a271c..763f856 100644
> >> --- a/libavutil/aes.c
> >> +++ b/libavutil/aes.c
> >> @@ -130,7 +130,7 @@ int av_aes_init(AVAES *a, const uint8_t *key, int key_bits, int decrypt) {
> >>      uint8_t  log8[256];
> >>      uint8_t alog8[512];
> >>  
> >> -    if(!enc_multbl[0][sizeof(enc_multbl)/sizeof(enc_multbl[0][0])-1]){
> >> +    if(!enc_multbl[FF_ARRAY_ELEMS(enc_multbl)-1][FF_ARRAY_ELEMS(enc_multbl[0])-1]){
> >>          j=1;
> >>          for(i=0; i<255; i++){
> >>              alog8[i]=
> >
> > This part is still relevant I think, and it does not look that much worse
> > readability-wise to me, and generated code should be identical...
> 
> I agree, though I'm waiting for Michael as don't want to step on
> anyone's toes again.

thanks and the above quoted change is ok with me

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100704/a999d204/attachment.pgp>



More information about the ffmpeg-devel mailing list