gdImageScale segfaults with most interpolation types
gdImageScale() will cause a segmentation fault unless the interpolation method (set via gdImageSetInterpolationMethod()) is one of GD_BILINEAR_FIXED, GD_BICUBIC_FIXED or GD_NEAREST_NEIGHBOUR.
In addition, setting mode GD_WEIGHTED4 will not segfault but will cause gdImageScale() to return 0.
Attached is a small program which reproduces the bug. It was run under Ubuntu 12.04/i686.
LibGD was compiled with:
./bootstrap.sh ./configure --prefix=/usr/local/ --with-tiff=/usr/lib/ --with-xpm=/usr/lib/ make sudo make install