Skip to content

Commit dd96d67

Browse files
author
Dirk Lemstra
committed
Added missing return to avoid use after free.
1 parent 422bbf5 commit dd96d67

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: Magick++/lib/Image.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -5140,9 +5140,14 @@ void Magick::Image::read(MagickCore::Image *image,
51405140
image == (MagickCore::Image *) NULL)
51415141
{
51425142
(void) MagickCore::DestroyExceptionInfo(exceptionInfo);
5143-
throwExceptionExplicit(ImageWarning,"No image was loaded.");
5143+
if (!quiet())
5144+
throwExceptionExplicit(MagickCore::ImageWarning,
5145+
"No image was loaded.");
5146+
}
5147+
else
5148+
{
5149+
ThrowImageException;
51445150
}
5145-
ThrowImageException;
51465151
if (image != (MagickCore::Image *) NULL)
51475152
throwException(&image->exception,quiet());
51485153
}

0 commit comments

Comments
 (0)