Tesseract OCR engine versions prior to 5.5.4 contain a use-after-free and double free vulnerability in the AppendLinePolygon function, which can corrupt memory and lead to crashes or denial of service. This flaw affects processing of right-to-left text such as Hebrew or Arabic. Additionally, a denial of service vulnerability exists in the WeightMatrix::DeSerialize function when loading crafted LSTM models, causing process termination. Both issues are fixed in version 5.5.4.