Fix issues detected by static analysis

This commit is contained in:
Stéphane Lesimple
2025-04-11 19:21:28 +02:00
parent d01aae080e
commit 64f31a8e5d
15 changed files with 36 additions and 24 deletions

View File

@@ -150,7 +150,7 @@ ReedSolomonTables *CreateReedSolomonTables(GaloisTables *gt,
* respectively (ndata+sp) mod nroots = 0 after working in all ndata layers.
*/
rt->shiftInit = rt->nroots - rt->ndata % rt->nroots;
rt->shiftInit = (rt->nroots == 0 ? 0 : rt->nroots - rt->ndata % rt->nroots);
if(rt->shiftInit == rt->nroots)
rt->shiftInit = 0;