In the development of oil and gas fields, due to the sand, calcium, and magnesium ions in the produced liquid, the under-deposit corrosion formed by deposition during the transportation process has become one of the key factors of pipeline failure. Therefore, aiming at the problem of CaCO3 under-deposit corrosion in CO2-flooded oil pipelines, this paper studied the influence of deposit thickness change on metal corrosion based on electrochemical experiments, image characterization, and corrosion product analysis. The results showed that the corrosion process of the deposit layer can be divided into three stages. (1) The deposit layer promoted the movement of the electrolyte and then enhanced the corrosion rate of the matrix, leading to the increase of the size and maximum pit depth of the matrix, which was manifested as a rapid negative shift of the open circuit potential. (2) The deposit layer played a certain physical shielding role, leading to the size and maximum pit depth of the pit decreasing, and the number of pits increasing, at which the open circuit potential basically remained unchanged. (3) The deposit layer can play an effective physical shielding role, and the oxygen concentration corrosion inside and outside the deposit layer made the number of pits increase sharply, which was manifested as a slow negative shift of open circuit potential. The deposit layer mainly affected the cathode reaction process of the corrosion process. With the increase of the deposit thickness, the metal corrosion intensified with an increasing corrosion current density.