avutil/cast5: Fix off by one error
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 20 Oct 2014 03:41:26 +0000 (05:41 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 20 Oct 2014 03:41:26 +0000 (05:41 +0200)
Fixes fate-cast5 on alpha

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/cast5.c

index 2309223..c0d6d1e 100644 (file)
@@ -457,7 +457,7 @@ av_cold int av_cast5_init(AVCAST5* cs, const uint8_t *key, int key_bits)
         q[i]=AV_RB32(newKey+(4*i));
     generate_round_keys(cs->rounds,cs->Km,q,p);
     generate_round_keys(cs->rounds,cs->Kr,q,p);
-    for (i=0;i<cs->rounds;i++)
+    for (i=0;i<=cs->rounds;i++)
         cs->Kr[i]=cs->Kr[i]&0x1f;
     return 0;
 }