Skip to content

Commit

Permalink
PdfPage_TextExtraction: Fix decodeString with no font
Browse files Browse the repository at this point in the history
Previously, the `positions` vector could have an incorrect length if the
current font is null.
  • Loading branch information
SeekingBlues authored and ceztko committed Dec 3, 2024
1 parent e17a7ce commit abb6176
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/podofo/main/PdfPage_TextExtraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,9 +683,9 @@ bool decodeString(const PdfString &str, TextState &state, string &decoded,
// CHECK-ME: Maybe intrepret them as PdfDocEncoding?
decoded = str.GetString();
lengths.resize(decoded.length());
positions.reserve(decoded.length());
positions.resize(decoded.length());
for (unsigned i = 0; i < decoded.length(); i++)
positions.push_back(i);
positions[i] = i;

return true;
}
Expand Down

0 comments on commit abb6176

Please sign in to comment.