Sidescan sonar (SSS) creates images through interpolation of scan lines. The instability of the transducer position caused by the vessel's turning and the boost from the swells, which leads to misalignment, overlapping, and uneven spacing of the scan lines (heading distortion), is a problem that has been largely overlooked in the processing of SSS data. The traditional interpolation method tends to cause serious mosaic and overlapping texture problems in SSS, which interferes with the subsequent image analysis work. Additionally, the practice of simply cutting and discarding also tends to waste resources. To enhance data usability, this article leverages the deep convolutional neural network (DCNN) to learn the correlations between textures, transforming the issue of heading anomaly correction into one of misalignment fusion in overlapping areas and gap texture filling, providing a feasible scheme for detecting scanning line heading anomalies and filling gaps. Addressing the lack of continuity in textures repaired by DCNN in larger gaps, a continuity-guided branch network is proposed to help the main repair network consider texture continuity. Through quantitative evaluation with real sonar images as a reference and qualitative evaluation without a real image reference, the effectiveness of the proposed method in filling gaps in scan lines with varying degrees of anomalies has been validated. For regions with minor heading anomalies, the method achieves repair results comparable to traditional interpolation techniques. In the area with large anomalies, the proposed method shows improvements over the traditional optimal method, with the peak signal-to-noise ratio index increase of over 5%, the structural similarity index improvement of over 20%, and the naturalness image quality evaluator index enhancement of over 8%, greatly enhancing the data's usability.