Skip to content

Commit

Permalink
Set the parameters to NAN inside GetImageChannelMean when GetImageCha…
Browse files Browse the repository at this point in the history
…nnelStatistics returns null.
  • Loading branch information
dlemstra committed May 6, 2024
1 parent e7e4c01 commit 2605fc7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion magick/statistic.c
Expand Up @@ -1600,7 +1600,11 @@ MagickExport MagickBooleanType GetImageChannelMean(const Image *image,
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
channel_statistics=GetImageChannelStatistics(image,exception);
if (channel_statistics == (ChannelStatistics *) NULL)
return(MagickFalse);
{
*mean=NAN;
*standard_deviation=NAN;
return(MagickFalse);
}
channels=0;
channel_statistics[CompositeChannels].mean=0.0;
channel_statistics[CompositeChannels].standard_deviation=0.0;
Expand Down

0 comments on commit 2605fc7

Please sign in to comment.