don't malloc pic buffer every time