[Fix] Returning illegal array in case that height/width of header/footer is 0.