@@ -340,6 +340,9 @@ static void nhmldmx_set_props(GF_NHMLDmxCtx *ctx, GF_XMLNode *props, GF_FilterPa
340340 } else {
341341 prop_type = GF_PROP_STRING ;
342342 }
343+ if (prop_type == GF_PROP_STRING_LIST ) {
344+ reset = GF_FALSE ;
345+ }
343346 GF_PropertyValue prop_val ;
344347 if (has_bs ) {
345348 GF_BitStream * bs = gf_bs_new (NULL , 0 , GF_BITSTREAM_WRITE );
@@ -357,16 +360,18 @@ static void nhmldmx_set_props(GF_NHMLDmxCtx *ctx, GF_XMLNode *props, GF_FilterPa
357360 if (p4cc ) {
358361 if (pck )
359362 gf_filter_pck_set_property (pck , p4cc , & prop_val );
360- else
363+ else {
361364 gf_filter_pid_set_property (ctx -> opid , p4cc , & prop_val );
365+ }
362366 } else {
363367 if (pck )
364368 gf_filter_pck_set_property_dyn (pck , pname , & prop_val );
365369 else
366370 gf_filter_pid_set_property_dyn (ctx -> opid , pname , & prop_val );
367371 }
368- if (reset )
372+ if (reset ) {
369373 gf_props_reset_single (& prop_val );
374+ }
370375 }
371376}
372377
@@ -842,7 +847,7 @@ static GF_Err nhmldmx_config_output(GF_Filter *filter, GF_NHMLDmxCtx *ctx, GF_XM
842847 if (init_name ) gf_free (init_name );
843848 return e ;
844849 }
845- } else if (ctx -> header_end ) {
850+ } else if (ctx -> header_end && ctx -> header_end < GF_UINT_MAX ) {
846851 /* for text based streams, the decoder specific info can be at the beginning of the file */
847852 specInfoSize = ctx -> header_end ;
848853 specInfo = (char * )gf_malloc (sizeof (char ) * (specInfoSize + 1 ));
@@ -859,11 +864,12 @@ static GF_Err nhmldmx_config_output(GF_Filter *filter, GF_NHMLDmxCtx *ctx, GF_XM
859864 if (init_name ) gf_free (init_name );
860865 return e ;
861866 }
862-
863- specInfo = (char * )gf_malloc (sizeof (char ) * (ctx -> samp_buffer_size + 1 ));
864- memcpy (specInfo , ctx -> samp_buffer , ctx -> samp_buffer_size );
865- specInfoSize = ctx -> samp_buffer_size ;
866- specInfo [specInfoSize ] = 0 ;
867+ if (ctx -> samp_buffer && ctx -> samp_buffer_size < GF_UINT_MAX ) {
868+ specInfo = (char * )gf_malloc (sizeof (char ) * (ctx -> samp_buffer_size + 1 ));
869+ memcpy (specInfo , ctx -> samp_buffer , ctx -> samp_buffer_size );
870+ specInfoSize = ctx -> samp_buffer_size ;
871+ specInfo [specInfoSize ] = 0 ;
872+ }
867873 }
868874
869875 i = 0 ;
@@ -873,6 +879,11 @@ static GF_Err nhmldmx_config_output(GF_Filter *filter, GF_NHMLDmxCtx *ctx, GF_XM
873879 if (!stricmp (node -> name , ctx -> is_dims ? "DIMSUnit" : "NHNTSample" ) ) break ;
874880 if (stricmp (node -> name , "DecoderSpecificInfo" ) ) continue ;
875881
882+ if (specInfo ) {
883+ gf_free (specInfo );
884+ specInfo = NULL ;
885+ specInfoSize = 0 ;
886+ }
876887 e = gf_xml_parse_bit_sequence (node , ctx -> src_url , & specInfo , & specInfoSize );
877888 if (e ) {
878889 if (specInfo ) gf_free (specInfo );
@@ -1511,6 +1522,11 @@ static GF_Err nhmldmx_send_sample(GF_Filter *filter, GF_NHMLDmxCtx *ctx)
15111522
15121523 char * content = gf_xml_dom_serialize (node , GF_TRUE , GF_FALSE );
15131524
1525+ if (!content ) {
1526+ GF_LOG (GF_LOG_ERROR , GF_LOG_PARSER , ("[NHMLDmx] import failure in sample %d: unable to serialize node\n" , ctx -> sample_num ));
1527+ return GF_NON_COMPLIANT_BITSTREAM ;
1528+ }
1529+
15141530 ctx -> samp_buffer_size = 3 + (u32 ) strlen (content );
15151531 if (ctx -> samp_buffer_alloc < ctx -> samp_buffer_size + 1 ) {
15161532 ctx -> samp_buffer_alloc = ctx -> samp_buffer_size + 1 ;
0 commit comments