swscale: check memory allocations