A new method for reducing metal artifacts in X-ray computed tomography (CT) images is presented. It bases on the solution of a convex optimization problem with inequality constraints on the sinogram, and total variation regularization for the reconstructed image. The Chambolle-Pock algorithm is used to numerically solve the discretized version of the optimization problem. As proof of concept we present and discuss numerical results for synthetic data.