Skip to content

Commit

Permalink
Set the parameters to NAN inside GetImageMean when GetImageStatistics…
Browse files Browse the repository at this point in the history
… returns null.
  • Loading branch information
dlemstra committed May 6, 2024
1 parent 2b42fc1 commit ea84110
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion MagickCore/statistic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,11 @@ MagickExport MagickBooleanType GetImageMean(const Image *image,double *mean,
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
channel_statistics=GetImageStatistics(image,exception);
if (channel_statistics == (ChannelStatistics *) NULL)
return(MagickFalse);
{
*mean=NAN;
*standard_deviation=NAN;
return(MagickFalse);
}
*mean=channel_statistics[CompositePixelChannel].mean;
*standard_deviation=
channel_statistics[CompositePixelChannel].standard_deviation;
Expand Down

0 comments on commit ea84110

Please sign in to comment.