Bug#2040: PNG encoding crash