Skip to content

Commit

Permalink
Fix null checks in fann_scale_train() and fann_descale_train().
Browse files Browse the repository at this point in the history
The argument is the same as for the previous commit: For completeness'
sake, we want to check the output scales for non-nullness, too, even
though it isn't strictly necessary.
  • Loading branch information
Nico Madysa committed Jul 24, 2018
1 parent 7bbe6f1 commit be74aef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fann_train_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ FANN_EXTERNAL void FANN_API fann_descale_output( struct fann *ann, fann_type *ou
FANN_EXTERNAL void FANN_API fann_scale_train( struct fann *ann, struct fann_train_data *data )
{
unsigned cur_sample;
if(ann->scale_mean_in == NULL)
if(ann->scale_mean_in == NULL || ann->scale_mean_out == NULL)
{
fann_error( (struct fann_error *) ann, FANN_E_SCALE_NOT_PRESENT );
return;
Expand All @@ -1144,7 +1144,7 @@ FANN_EXTERNAL void FANN_API fann_scale_train( struct fann *ann, struct fann_trai
FANN_EXTERNAL void FANN_API fann_descale_train( struct fann *ann, struct fann_train_data *data )
{
unsigned cur_sample;
if(ann->scale_mean_in == NULL)
if(ann->scale_mean_in == NULL || ann->scale_mean_out == NULL)
{
fann_error( (struct fann_error *) ann, FANN_E_SCALE_NOT_PRESENT );
return;
Expand Down

0 comments on commit be74aef

Please sign in to comment.