Fixbug: gd warning: one parameter to a memory allocation multiplication is negative or zero.