Usually such functions allow a NULL buffer to let the function estimate the size of the processed data