Forget to check for _dataLength in commit 6be1a4707f (new line for after stream write)

This commit is contained in:
Grégory Soutadé 2022-03-16 10:47:43 +01:00
parent e4e6160a6b
commit 9d56c1d0b1
1 changed files with 2 additions and 1 deletions

View File

@ -107,7 +107,8 @@ namespace uPDFParser
const char* streamData = (const char*)data(); // Force reading if not in memory
res += std::string(streamData, _dataLength);
// Be sure there is a final line return
if (streamData[_dataLength-1] != '\n' &&
if (_dataLength &&
streamData[_dataLength-1] != '\n' &&
streamData[_dataLength-1] != '\r')
res += "\n";
res += "endstream\n";