oc-rtf: control words can also have a space before next tag
This was causing to parse a single space as an empty control word with length 0, which was the source of several crashes. Example: \f0\fbidi \fcharset0 --------^ font index is 0, font family is bidi but when parsing charset we were assuming control word was '' instead of 'charset0'. This only fixes the crashes, the parseFontTable function works quite awful right now.pull/69/head
parent
a7c2054cce
commit
05578bfcb6
|
@ -412,16 +412,17 @@ const unsigned short ansicpg874[256] = {
|
|||
- (const char *) parseControlWord: (unsigned int *) len
|
||||
{
|
||||
const char *start, *end;
|
||||
|
||||
|
||||
start = ADVANCE;
|
||||
|
||||
while (isalnum(*_bytes) || *_bytes == '-')
|
||||
|
||||
while (isalnum(*_bytes) || *_bytes == '-' || isspace(*_bytes))
|
||||
{
|
||||
ADVANCE;
|
||||
}
|
||||
end = _bytes;
|
||||
|
||||
|
||||
*len = end-start-1;
|
||||
|
||||
return start+1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue