Skip to content
Snippets Groups Projects
Commit f3994d3f authored by Franck Dary's avatar Franck Dary
Browse files

Fixed an overflow

parent 3ccdd755
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
void mcd_remove_wf_column(mcd *m, int wf_code) void mcd_remove_wf_column(mcd *m, int wf_code)
{ {
int col = m->wf2col[wf_code]; int col = m->wf2col[wf_code];
if(col < 0 || col >= m->nb_col)
return;
m->wf2col[wf_code] = -1; m->wf2col[wf_code] = -1;
m->representation[col] = MCD_REPRESENTATION_NULL; m->representation[col] = MCD_REPRESENTATION_NULL;
...@@ -19,7 +23,6 @@ void mcd_remove_wf_column(mcd *m, int wf_code) ...@@ -19,7 +23,6 @@ void mcd_remove_wf_column(mcd *m, int wf_code)
m->filename[col] = NULL; m->filename[col] = NULL;
m->dico_array[col] = NULL; m->dico_array[col] = NULL;
m->word_emb_array[col] = NULL; m->word_emb_array[col] = NULL;
} }
mcd *mcd_new(int nb_col) mcd *mcd_new(int nb_col)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment