I have rebuilded imagemagick with gcc4.7 and it does not change anything. Moreover running this program under valgrind does not segfault Bastien