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.
This commit is contained in:
Enrique J. Hernández Blasco 2014-10-03 23:23:01 +02:00 committed by Julio García
parent cbfcd54858
commit 75ce59d010

View file

@ -756,16 +756,16 @@ const unsigned short ansicpg874[256] = {
{ {
// We rewind our buffer so we start at the beginning of {\fonttbl... // We rewind our buffer so we start at the beginning of {\fonttbl...
_bytes = cw-2; _bytes = cw-2;
_current_pos -= 10; _current_pos -= 9; // Length: {\fonttbl
fontTable = [self parseFontTable]; 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; REWIND;
} }
else if (strncmp(cw, "stylesheet", 10) == 0) else if (strncmp(cw, "stylesheet", 10) == 0)
{ {
_bytes = cw-2; _bytes = cw-2;
_current_pos -= 13; _current_pos -= 12; // Length: {\stylesheet
[self parseStyleSheet]; [self parseStyleSheet];
REWIND; REWIND;
} }
@ -776,7 +776,7 @@ const unsigned short ansicpg874[256] = {
else if (strncmp(cw, "pict", 4) == 0) else if (strncmp(cw, "pict", 4) == 0)
{ {
_bytes = cw-2; _bytes = cw-2;
_current_pos -= 7; _current_pos -= 6; // Length: {\pict
[self parsePicture]; [self parsePicture];
REWIND; REWIND;
} }