in some cases it's possible for giflib/libungif to return color indexes outside the range of colors defined by the image's palette. We now expand the palette to match the indexes used. Thanks to Gabriel Vasseur for reporting this.
fixed various memory leaks that could occur when failing to read png, jpeg, bmp or tga files.
to avoid confusion, channels not present in the image are returned as zero by getscanline(). This has no effect on the C level i_glin() and i_glinf() API functions which continue to not set the unused channels.