Fix seg fault when outputdpi is 0