@@ -449,6 +449,7 @@ static Bool svg_parse_animation(GF_SVG_Parser *parser, GF_SceneGraph *sg, SVG_De
449449 if (anim -> to ) {
450450 /* now that we have a target, if there is a to value to parse, create the attribute and parse it */
451451 gf_node_get_attribute_by_tag ((GF_Node * )anim -> animation_elt , TAG_SVG_ATT_to , GF_TRUE , GF_FALSE , & info );
452+ if (!info .name ) info .name = "to" ;
452453 gf_svg_parse_attribute ((GF_Node * )anim -> animation_elt , & info , anim -> to , anim_value_type );
453454 if (anim_value_type == XMLRI_datatype ) {
454455 svg_post_process_href (parser , (GF_Node * ) anim -> target , (XMLRI * )((SMIL_AnimateValue * )info .far_ptr )-> value );
@@ -457,20 +458,23 @@ static Bool svg_parse_animation(GF_SVG_Parser *parser, GF_SceneGraph *sg, SVG_De
457458 if (anim -> from ) {
458459 /* now that we have a target, if there is a from value to parse, create the attribute and parse it */
459460 gf_node_get_attribute_by_tag ((GF_Node * )anim -> animation_elt , TAG_SVG_ATT_from , GF_TRUE , GF_FALSE , & info );
461+ if (!info .name ) info .name = "from" ;
460462 gf_svg_parse_attribute ((GF_Node * )anim -> animation_elt , & info , anim -> from , anim_value_type );
461463 if (anim_value_type == XMLRI_datatype )
462464 svg_post_process_href (parser , (GF_Node * ) anim -> target , (XMLRI * )((SMIL_AnimateValue * )info .far_ptr )-> value );
463465 }
464466 if (anim -> by ) {
465467 /* now that we have a target, if there is a by value to parse, create the attribute and parse it */
466468 gf_node_get_attribute_by_tag ((GF_Node * )anim -> animation_elt , TAG_SVG_ATT_by , GF_TRUE , GF_FALSE , & info );
469+ if (!info .name ) info .name = "by" ;
467470 gf_svg_parse_attribute ((GF_Node * )anim -> animation_elt , & info , anim -> by , anim_value_type );
468471 if (anim_value_type == XMLRI_datatype )
469472 svg_post_process_href (parser , (GF_Node * ) anim -> target , (XMLRI * )((SMIL_AnimateValue * )info .far_ptr )-> value );
470473 }
471474 if (anim -> values ) {
472475 /* now that we have a target, if there is a 'values' value to parse, create the attribute and parse it */
473476 gf_node_get_attribute_by_tag ((GF_Node * )anim -> animation_elt , TAG_SVG_ATT_values , GF_TRUE , GF_FALSE , & info );
477+ if (!info .name ) info .name = "values" ;
474478 gf_svg_parse_attribute ((GF_Node * )anim -> animation_elt , & info , anim -> values , anim_value_type );
475479 if (anim_value_type == XMLRI_datatype ) {
476480 u32 i , count ;
@@ -2119,13 +2123,13 @@ GF_Err load_svg_run(GF_SceneLoader *load)
21192123
21202124 in_time = gf_sys_clock ();
21212125 e = gf_xml_sax_parse_file (parser -> sax_parser , (const char * )load -> fileName , svg_progress );
2126+ svg_flush_animations (parser );
2127+ gf_sm_svg_flush_state (parser );
21222128 if (parser -> last_error < 0 ) e = parser -> last_error ;
2123-
2129+
21242130 if (e < 0 ) return svg_report (parser , e , "Unable to parse file %s: %s" , load -> fileName , gf_xml_sax_get_error (parser -> sax_parser ) );
21252131 GF_LOG (GF_LOG_INFO , GF_LOG_PARSER , ("[Parser] Scene parsed and Scene Graph built in %d ms\n" , gf_sys_clock () - in_time ));
21262132
2127- svg_flush_animations (parser );
2128- gf_sm_svg_flush_state (parser );
21292133 return e ;
21302134
21312135}
0 commit comments