Fix possible stack corruption.

This commit is contained in:
John Preston 2019-09-01 12:04:26 +03:00
parent 51066168ac
commit 7815337204

View File

@ -1736,13 +1736,16 @@ void LottieParserImpl::getValue(std::vector<VPointF> &v)
void LottieParserImpl::getValue(VPointF &pt)
{
float val[4];
float val[4] = {0.f};
int i = 0;
if (PeekType() == kArrayType) EnterArray();
while (NextArrayValue()) {
val[i++] = GetDouble();
const auto value = GetDouble();
if (i < 4) {
val[i++] = value;
}
}
pt.setX(val[0]);
pt.setY(val[1]);
@ -1766,12 +1769,15 @@ void LottieParserImpl::getValue(float &val)
void LottieParserImpl::getValue(LottieColor &color)
{
float val[4];
float val[4] = {0.f};
int i = 0;
if (PeekType() == kArrayType) EnterArray();
while (NextArrayValue()) {
val[i++] = GetDouble();
const auto value = GetDouble();
if (i < 4) {
val[i++] = value;
}
}
color = applyReplacements(LottieColor(val[0], val[1], val[2]));
}