Follow-up on UniqueFileIdentifierFrame weirdness

Scott Wheeler wheeler at kde.org
Fri Aug 11 16:06:31 CEST 2006


On Saturday 29 July 2006 16:33, Jeff Mitchell wrote:
> Scott--
>
> You asked me to follow up if I did some testing...here are some results

[...]

> QString temp = TStringToQString( TagLib::String( ourMP3UidFrame( file,
> ourId )->identifier().data() ) );

After looking at things more closely (along with the stuff you sent me) I 
should have worded my earlier list responce more strongly.

The "extra"  .data() call in there isn't just "extra", it's in fact the source 
of the problems.  There is a copy constructor for TagLib::String that accepts 
a byte vector, but if you call .data() there's a conversion to a 
non-null-terminated C-array.  When you pass that into the String constructor 
it's looking for the first null byte to indicate the end of the string.  It 
just happens that such is coming a few characters later.

-Scott


-- 
diff -u life.cpp~ life.cpp
--- life.cpp~   2002/03/19 07:44:28
+++ life.cpp   2002/04/09 15:49:39
-#include <sleep.h>
+#include <caffeine.h>


More information about the taglib-devel mailing list