Dali::Property::Value property(Property::ARRAY);
if( DeterminePropertyFromNode( keyValue.second, Property::ARRAY, property, replacements ) )
{
- transitionData = Toolkit::TransitionData::New( *property.GetArray() );
+ if( property.GetArray() )
+ {
+ transitionData = Toolkit::TransitionData::New( *property.GetArray() );
+ }
}
}
else if( node.GetType() == TreeNode::OBJECT )
Dali::Property::Value property(Property::MAP);
if( DeterminePropertyFromNode( keyValue.second, Property::MAP, property, replacements ) )
{
- transitionData = Toolkit::TransitionData::New( *property.GetMap() );
+ if( property.GetMap() )
+ {
+ transitionData = Toolkit::TransitionData::New( *property.GetMap() );
+ }
}
}
}
int end = 0;
char quote;
+ /**
+ * In the original file, 's' is not compared to NULL value before it is dereferenced.
+ */
+ if (!s)
+ {
+ return;
+ }
+
// Skip white space after the '<'
while (*s && nsvg__isspace(*s)) s++;
return;
shape = (NSVGshape*)malloc(sizeof(NSVGshape));
- if (shape == NULL) goto error;
+
+ /**
+ * In the original file, if shape is NULL it goto error below 'return' and free shape memory.
+ * But, the error is only visited when shape is NULL, so there is not needed to free it.
+ */
+ if (shape == NULL) return;
memset(shape, 0, sizeof(NSVGshape));
memcpy(shape->id, attr->id, sizeof shape->id);
p->shapesTail = shape;
return;
-
-error:
- if (shape) free(shape);
}
static void nsvg__addPath(NSVGparser* p, char closed)
static float nsvg__parseOpacity(const char* str)
{
- float val = nsvg__atof(str);\r
+ float val = nsvg__atof(str);
if (val < 0.0f) val = 0.0f;
if (val > 1.0f) val = 1.0f;
return val;
error:
if (fp) fclose(fp);
if (data) free(data);
- if (image) nsvgDelete(image);
+ /**
+ * In the original file, image has null check and free it here. But because image has data after all of the 'goto error',
+ * 'free(image)' was unreachable. So, we removed it.
+ */
return NULL;
}
nextChild_(nullptr),
config_(nullptr),
isDirty_(false),
- resolvedDimensions_({{YGValueUndefined, YGValueUndefined}}) {}
+ resolvedDimensions_(std::array<YGValue, 2>{YGValueUndefined, YGValueUndefined}) {}
+ /**
+ * In the original file, to initialize resolvedDimensions_ above, we usee { { YGValueUndefined, YGValueUndefined } }.
+ * But it is not well work, so we modified it.
+ */
YGNode::YGNode(const YGNode& node)
: context_(node.context_),