@@ -469,12 +469,13 @@ void _taglib_property_set(TagLib_File *file, const char* prop, const char* value
469469 return ;
470470
471471 auto tfile = reinterpret_cast <FileRef *>(file);
472+ auto propStr = charArrayToString (prop);
472473 PropertyMap map = tfile->tag ()->properties ();
473474
474475 if (value) {
475- auto property = map.find (prop );
476+ auto property = map.find (propStr );
476477 if (property == map.end ()) {
477- map.insert (prop , StringList (charArrayToString (value)));
478+ map.insert (propStr , StringList (charArrayToString (value)));
478479 }
479480 else {
480481 if (append) {
@@ -486,7 +487,7 @@ void _taglib_property_set(TagLib_File *file, const char* prop, const char* value
486487 }
487488 }
488489 else {
489- map.erase (prop );
490+ map.erase (propStr );
490491 }
491492
492493 tfile->setProperties (map);
@@ -531,7 +532,7 @@ char **taglib_property_get(const TagLib_File *file, const char *prop)
531532
532533 const PropertyMap map = reinterpret_cast <const FileRef *>(file)->properties ();
533534
534- auto property = map.find (prop);
535+ auto property = map.find (charArrayToString ( prop) );
535536 if (property == map.end ())
536537 return NULL ;
537538
@@ -573,16 +574,17 @@ bool _taglib_complex_property_set(
573574 return false ;
574575
575576 auto tfile = reinterpret_cast <FileRef *>(file);
577+ auto keyStr = charArrayToString (key);
576578
577579 if (value == NULL ) {
578- return tfile->setComplexProperties (key , {});
580+ return tfile->setComplexProperties (keyStr , {});
579581 }
580582
581583 VariantMap map;
582584 const TagLib_Complex_Property_Attribute** attrPtr = value;
583585 while (*attrPtr) {
584586 const TagLib_Complex_Property_Attribute *attr = *attrPtr;
585- String attrKey (attr->key );
587+ auto attrKey = charArrayToString (attr->key );
586588 switch (attr->value .type ) {
587589 case TagLib_Variant_Void:
588590 map.insert (attrKey, Variant ());
@@ -627,8 +629,8 @@ bool _taglib_complex_property_set(
627629 ++attrPtr;
628630 }
629631
630- return append ? tfile->setComplexProperties (key , tfile->complexProperties (key ).append (map))
631- : tfile->setComplexProperties (key , {map});
632+ return append ? tfile->setComplexProperties (keyStr , tfile->complexProperties (keyStr ).append (map))
633+ : tfile->setComplexProperties (keyStr , {map});
632634}
633635
634636} // namespace
@@ -676,7 +678,7 @@ TagLib_Complex_Property_Attribute*** taglib_complex_property_get(
676678 return NULL ;
677679 }
678680
679- const auto variantMaps = reinterpret_cast <const FileRef *>(file)->complexProperties (key);
681+ const auto variantMaps = reinterpret_cast <const FileRef *>(file)->complexProperties (charArrayToString ( key) );
680682 if (variantMaps.isEmpty ()) {
681683 return NULL ;
682684 }
0 commit comments