Guard against bogus values of ph.width, ph.height and document why there are no allocation overflows.