Segmentaion Fault Loading Largish JPEG (with sample code)

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
mankyd

Segmentaion Fault Loading Largish JPEG (with sample code)

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick »

We tried your code with the latest ImageMagick release, 6.3.2-2, and it worked without complaint.
mankyd

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

Post 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.
Post Reply