fix seg fault when decoding gif on my ubuntu machine