So O2 has zero of heat of formation (or enthalpy of formation). The enthalpy of a reaction is defined like this: H = Hproducts-H reactants. The enthalpy of reaction in this case, is the same as the heat of combustion. Hproducts is obtained summing the heats of formation.