ensure return after memory allocation failure (#2449, CVS-2013-4232)
make more resistent to corrupt/hostile input files (#2450, CVE-2013-4231)
fix possible OOB write in gif2tiff.c