I think the question, as per Vattel Martens, is far broader and includes the idea of some sort of "right of safety" for the locals, a right not to get forraged and pillaged and so on.
Clearly, rape was punishable under the French military code. And some were so punished indeed. Marauders were shot by Davout in 1812, but more for desertion or acting without orders, not for ruining the lives and livlihoods of the Russians or Belarussians or Lithuanians.