oc-rtf: Fix current position to match where _bytes pointer is

This avoids to have extra unknown bytes at the end of the RTF document
as _len would have been reached but _current_pos had incorrect less value.
pull/69/head
Enrique J. Hernández Blasco 2014-10-03 23:23:01 +02:00 committed by Julio García
parent cbfcd54858
commit 75ce59d010
1 changed files with 4 additions and 4 deletions

View File

@ -756,16 +756,16 @@ const unsigned short ansicpg874[256] = {
{
// We rewind our buffer so we start at the beginning of {\fonttbl...
_bytes = cw-2;
_current_pos -= 10;
_current_pos -= 9; // Length: {\fonttbl
fontTable = [self parseFontTable];
// We go back 1 byte in order to end our section properly ('}' character
// We go back 1 byte in order to end our section properly ('}' character)
REWIND;
}
else if (strncmp(cw, "stylesheet", 10) == 0)
{
_bytes = cw-2;
_current_pos -= 13;
_current_pos -= 12; // Length: {\stylesheet
[self parseStyleSheet];
REWIND;
}
@ -776,7 +776,7 @@ const unsigned short ansicpg874[256] = {
else if (strncmp(cw, "pict", 4) == 0)
{
_bytes = cw-2;
_current_pos -= 7;
_current_pos -= 6; // Length: {\pict
[self parsePicture];
REWIND;
}