@@ -7844,6 +7844,9 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
78447844 clut_image = RemoveFirstImageFromList (images );
78457845 if (clut_image == (Image * ) NULL )
78467846 {
7847+ (void ) ThrowMagickException (exception ,GetMagickModule (),
7848+ OptionError ,"ImageSequenceRequired" ,"`%s'" ,option );
7849+ image = DestroyImage (image );
78477850 status = MagickFalse ;
78487851 break ;
78497852 }
@@ -7888,9 +7891,6 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
78887891 }
78897892 if (LocaleCompare ("compare" ,option + 1 ) == 0 )
78907893 {
7891- const char
7892- * option ;
7893-
78947894 double
78957895 distortion ;
78967896
@@ -7911,6 +7911,9 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
79117911 reconstruct_image = RemoveFirstImageFromList (images );
79127912 if (reconstruct_image == (Image * ) NULL )
79137913 {
7914+ (void ) ThrowMagickException (exception ,GetMagickModule (),
7915+ OptionError ,"ImageSequenceRequired" ,"`%s'" ,option );
7916+ image = DestroyImage (image );
79147917 status = MagickFalse ;
79157918 break ;
79167919 }
@@ -7966,6 +7969,9 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
79667969 composite_image = RemoveFirstImageFromList (images );
79677970 if (composite_image == (Image * ) NULL )
79687971 {
7972+ (void ) ThrowMagickException (exception ,GetMagickModule (),
7973+ OptionError ,"ImageSequenceRequired" ,"`%s'" ,option );
7974+ image = DestroyImage (image );
79697975 status = MagickFalse ;
79707976 break ;
79717977 }
@@ -8197,6 +8203,9 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
81978203 hald_image = RemoveFirstImageFromList (images );
81988204 if (hald_image == (Image * ) NULL )
81998205 {
8206+ (void ) ThrowMagickException (exception ,GetMagickModule (),
8207+ OptionError ,"ImageSequenceRequired" ,"`%s'" ,option );
8208+ image = DestroyImage (image );
82008209 status = MagickFalse ;
82018210 break ;
82028211 }
@@ -8227,11 +8236,16 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
82278236 phase_image = RemoveFirstImageFromList (images );
82288237 if (phase_image == (Image * ) NULL )
82298238 {
8239+ (void ) ThrowMagickException (exception ,GetMagickModule (),
8240+ OptionError ,"ImageSequenceRequired" ,"`%s'" ,option );
8241+ magnitude_image = DestroyImage (magnitude_image );
82308242 status = MagickFalse ;
82318243 break ;
82328244 }
82338245 fourier_image = InverseFourierTransformImage (magnitude_image ,
82348246 phase_image ,* option == '-' ? MagickTrue : MagickFalse ,exception );
8247+ magnitude_image = DestroyImage (magnitude_image );
8248+ phase_image = DestroyImage (phase_image );
82358249 if (fourier_image == (Image * ) NULL )
82368250 break ;
82378251 if (* images != (Image * ) NULL )
0 commit comments