swscale: prevent overflow during initialization