diff options
author | Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> | 2023-05-18 17:10:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-18 17:10:03 +0300 |
commit | c9ab5c67c2dab6df9f901cbf20fa1b73869ce4cd (patch) | |
tree | ca7ae047f093251c11a66df92ac4af70a8117cb5 /ml/ml.cc | |
parent | 5827732aa706db68bf50cdeb1b53fecc3b14f2f9 (diff) |
Fix CodeQL warning (#15062)
Fix CodeQL warning "Multiplication result may overflow 'unsigned int' before it is converted to 'size_t'"
Diffstat (limited to 'ml/ml.cc')
-rw-r--r-- | ml/ml.cc | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1565,7 +1565,7 @@ void ml_init() for (size_t idx = 0; idx != Cfg.num_training_threads; idx++) { ml_training_thread_t *training_thread = &Cfg.training_threads[idx]; - size_t max_elements_needed_for_training = Cfg.max_train_samples * (Cfg.lag_n + 1); + size_t max_elements_needed_for_training = (size_t) Cfg.max_train_samples * (size_t) (Cfg.lag_n + 1); training_thread->training_cns = new calculated_number_t[max_elements_needed_for_training](); training_thread->scratch_training_cns = new calculated_number_t[max_elements_needed_for_training](); |