Again: pointer being freed was not allocated
Posted: 2012-07-29T22:09:56-07:00
Some time ago, I posted about a bug that, according to magick on 29-5-2012 has been corrected. As of today, that bug is still present in the MacPorts release.
Here is a minimal example:
$ port list ImageMagick
ImageMagick @6.7.8-3 graphics/ImageMagick
$ wget http://www.imagemagick.org/image/logo.jpg
...
$ identify logo.jpg
$ logo.jpg JPEG 123x118 123x118+0+0 8-bit DirectClass 16.2KB 0.000u 0:00.000
$ cat minimal.cxx
$ g++ `Magick++-config --cppflags --cxxflags --ldflags --libs` -o minimal minimal.cxx
$ ./minimal
minimal(18180) malloc: *** error for object 0xb00007fff48c14c7: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
$
Here is a minimal example:
$ port list ImageMagick
ImageMagick @6.7.8-3 graphics/ImageMagick
$ wget http://www.imagemagick.org/image/logo.jpg
...
$ identify logo.jpg
$ logo.jpg JPEG 123x118 123x118+0+0 8-bit DirectClass 16.2KB 0.000u 0:00.000
$ cat minimal.cxx
Code: Select all
#include <iostream>
#include <Magick++.h>
using namespace std;
using namespace Magick;
int main() {
try {
Image sourceImage("logo.jpg");
Image newImage(sourceImage);
newImage.zoom("50x");
newImage.write("newlogo.jpg");
} catch (Error &e) {
cerr << e.what() << '\n';
} catch (...) {
cerr << "Unknown exception catched\n";
}
}
$ ./minimal
minimal(18180) malloc: *** error for object 0xb00007fff48c14c7: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
$