Since lyxscale is unsigned, a negative value would lead to a very
large positive value.
Spotted by coverity.
filename = buffer.getReferencedFileName(name);
break;
}
filename = buffer.getReferencedFileName(name);
break;
}
case EX_DISPLAY: {
lex.next();
display = lex.getString() != "false";
break;
}
case EX_DISPLAY: {
lex.next();
display = lex.getString() != "false";
break;
}
- lyxscale = lex.getInteger();
+ int const ls = lex.getInteger();
+ // negative values are not accepted.
+ if (ls >= 0)
+ lyxscale = ls;
+ else
+ lex.printError("ExternalInset::read: Wrong lyxscale: $$Token");
case EX_DRAFT:
draft = true;
case EX_DRAFT:
draft = true;
if (lyxerr.debugging(Debug::EXTERNAL)) {
lyxerr << "InsetExternalParams::read:\n";
if (lyxerr.debugging(Debug::EXTERNAL)) {
lyxerr << "InsetExternalParams::read:\n";
- // false positive
- // coverity[NEGATIVE_RETURNS]