diff --git a/jni/NativeFormats/fbreader/src/formats/rtf/RtfDescriptionReader.cpp b/jni/NativeFormats/fbreader/src/formats/rtf/RtfDescriptionReader.cpp index c3fee6a6e..846712766 100644 --- a/jni/NativeFormats/fbreader/src/formats/rtf/RtfDescriptionReader.cpp +++ b/jni/NativeFormats/fbreader/src/formats/rtf/RtfDescriptionReader.cpp @@ -44,7 +44,7 @@ bool RtfDescriptionReader::readDocument(const ZLFile &file) { } void RtfDescriptionReader::addCharData(const char *data, size_t len, bool convert) { - if (myDoRead) { + if (myDoRead && len > 0) { if (convert) { myConverter->convert(myBuffer, data, data + len); } else { diff --git a/jni/NativeFormats/fbreader/src/formats/rtf/RtfReader.cpp b/jni/NativeFormats/fbreader/src/formats/rtf/RtfReader.cpp index 61432d95d..0170d1e7b 100644 --- a/jni/NativeFormats/fbreader/src/formats/rtf/RtfReader.cpp +++ b/jni/NativeFormats/fbreader/src/formats/rtf/RtfReader.cpp @@ -49,7 +49,7 @@ RtfFontPropertyCommand::RtfFontPropertyCommand(RtfReader::FontProperty property) } void RtfFontPropertyCommand::run(RtfReader &reader, int *parameter) const { - bool start = (parameter == 0) || (*parameter != 0); + const bool start = (parameter == 0) || (*parameter != 0); switch (myProperty) { case RtfReader::FONT_BOLD: if (reader.myState.Bold != start) {