Page 1 of 1

Segmentaion Fault Loading Largish JPEG (with sample code)

Posted: 2007-02-04T15:22:26-07:00
by mankyd
Running Centos 4, ImageMagick++ 6.0.7.1, the following sample program seg-faults with the provided image:

Code: Select all

#include <iostream>
#include <Magick++.h>
#include <string>

using namespace Magick;
using namespace std;

int main(int argc, char *argv[]) {
        Image *source_img;

        if (argc < 2)
                return -1;

        source_img = new Image();
        try {
                cout << "loading: " << argv[1] << endl;
                source_img->read(string(argv[1]));  //this line fails
                cout << "loaded" << endl;
        } catch (const exception &error) {
                throw;
        }

        delete source_img;
        source_img = NULL;

        return 0;
}
image: http://static.flickr.com/85/206793522_f5b98bed68_o.jpg

run command:

Code: Select all

./test http://static.flickr.com/85/206793522_f5b98bed68_o.jpg
Two other similar, but smaller images work just fine:
http://static.flickr.com/85/206793522_f5b98bed68.jpg
http://static.flickr.com/85/206793522_f5b98bed68_b.jpg

Re: Segmentaion Fault Loading Largish JPEG (with sample code)

Posted: 2007-02-04T16:47:07-07:00
by magick
We tried your code with the latest ImageMagick release, 6.3.2-2, and it worked without complaint.

Re: Segmentaion Fault Loading Largish JPEG (with sample code)

Posted: 2007-02-05T06:51:57-07:00
by mankyd
Hmm, I'll have to do some more investigating. Unfortunately a newer version of ImageMagick is not available to me at this time without manually trying to install glibc 2.4, (along with a bunch of other dependencies,) which isn't supported under centos 4. Thanks for the feedback though.