STL list iterator not dereferencable

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
kmblack1
Posts: 1
Joined: 2018-02-07T00:20:47-07:00
Authentication code: 1152

STL list iterator not dereferencable

Post by kmblack1 » 2018-02-07T00:26:59-07:00

MagickCore::Image* images = MagickCore::CoalesceImages( first_->image(),
exceptionInfo);
// Unlink image list
unlinkImages(first_, last_);

// Ensure container is empty
coalescedImages_->clear();       // first_ invalidation after clear

// Move images to container
insertImages( coalescedImages_, images );

// Report any error
ThrowPPException( first_->quiet());   //the program crashes here.first_ invalidation

my change is ok
MagickCore::Image* images = MagickCore::CoalesceImages( first_->image(),
exceptionInfo);
// Unlink image list
unlinkImages(first_, last_); bool quiet = first_->quiet();

// Ensure container is empty
coalescedImages_->clear();

// Move images to container
insertImages( coalescedImages_, images );

// Report any error
ThrowPPException(quiet);

User avatar
dlemstra
Posts: 1419
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: STL list iterator not dereferencable

Post by dlemstra » 2018-02-08T11:57:49-07:00

Thanks for reporting this. This was not the only spot where we made this mistake. We have applied your patch at all those spots. This will be resolved in the next release of ImageMagick.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

Post Reply