Skip to contentSkip to conversation

reed-solomon lib

DISCUSSION Simon Sudler 2 participants 2 messages Aug 1, 2005

lore
Share & tools
lore
#0 lore raw

Hi folks,

I'm working with the reed-solomon lib. Since i use a RS(255,191,64) code, i found a strange limitation in the reed_solomon.c:

194: /* Sanity checks */

        if (symsize < 1)
                return NULL;
        if (fcr < 0 || fcr >= (1<<symsize))
                return NULL;
        if (prim <= 0 || prim >= (1<<symsize))
                return NULL;
        if (nroots < 0 || nroots >= (1<<symsize) || nroots > 8)
                return NULL;

in line 201 the nroot are limited to max 8. I checkt the original code from Phil Karn (http://cache.qualcomm.com/code/fec/)
in witch is no limitation. After a closer look a the original code, i couldn't find any relevant difference exept for the line above.
After removing of the "nroots > 8" my code was working fine... perhaps someone was to carful to avoid a errors with the kmalloc function in rs_init.

Cheers,
Simon

#1 lore raw
Quoted 2 lines · Simon Sudler
         if (nroots < 0 || nroots >= (1<<symsize) || nroots > 8)
                 return NULL;

....

Quoted 3 lines

After removing of the "nroots > 8" my code was working fine... perhaps someone was to carful to avoid a errors with the kmalloc function in rs_init.

Honestly, I don't remember why it is there. Definitely not due to the kmalloc. It can be safely removed. I'll fix this.

tglx