[mndiff]: r131 - in trunk/noe: gfft.c gfft.h
Author: michael Date: Sun Feb 1 12:44:49 2009 New Revision: 131 Log: The element one past the last of noe_revTable was used and lead to undefined behavior (though by luck worked for me) in case the first symbol was erased. Extending the table fixes it. Modified: trunk/noe/gfft.c trunk/noe/gfft.h Modified: trunk/noe/gfft.c ============================================================================== --- trunk/noe/gfft.c Wed Nov 26 00:48:52 2008 (r130) +++ trunk/noe/gfft.c Sun Feb 1 12:44:49 2009 (r131) @@ -25,12 +25,12 @@ #include "galois_internal.h" #include "gfft.h" -uint8_t noe_revTable[256]; +uint8_t noe_revTable[257]; void noe_gfft_init(){ int i; - for(i=0; i<256; i++){ + for(i=0; i<257; i++){ int x= i; x = ((x & 0xaa) >> 1) | ((x & 0x55) << 1); x = ((x & 0xcc) >> 2) | ((x & 0x33) << 2); Modified: trunk/noe/gfft.h ============================================================================== --- trunk/noe/gfft.h Wed Nov 26 00:48:52 2008 (r130) +++ trunk/noe/gfft.h Sun Feb 1 12:44:49 2009 (r131) @@ -21,7 +21,7 @@ void EXT(gfft)(GFF4Element *dst, GFF4Ele void EXT(igfft)(GFF4Element *dst, GFF4Element *src, int size); void EXT(permute)(GFF4Element *dst, GFF4Element *src, int outCount, int codeBits); -extern uint8_t noe_revTable[256]; +extern uint8_t noe_revTable[257]; static inline unsigned int bitReverse(unsigned int x, int codeBits){ #if SHIFT==16
participants (1)
-
michael