[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesupport/taglib/taglib
From:       Nick Shaforostoff <shafff () ukr ! net>
Date:       2011-01-28 13:18:37
Message-ID: 20110128131837.49BBAAC8BB () svn ! kde ! org
[Download RAW message or body]

SVN commit 1217766 by shaforo:

fix crash on wma file parsing, add clarifications to API docs
CCMAIL: wheeler@kde.org



 M  +4 -0      asf/asffile.cpp  
 M  +3 -0      fileref.h  
 M  +7 -0      toolkit/tstring.h  


--- trunk/kdesupport/taglib/taglib/asf/asffile.cpp #1217765:1217766
@@ -148,7 +148,11 @@
 
 void ASF::File::BaseObject::parse(ASF::File *file, unsigned int size)
 {
+  data.clear();
+  if (size > 24 && size <= file->length())
   data = file->readBlock(size - 24);
+  else
+    data = ByteVector::null;
 }
 
 ByteVector ASF::File::BaseObject::render(ASF::File * /*file*/)
--- trunk/kdesupport/taglib/taglib/fileref.h #1217765:1217766
@@ -149,6 +149,9 @@
      * \warning This pointer will become invalid when this FileRef and all
      * copies pass out of scope.
      *
+     * \warning Do not cast it to any subclasses of \class Tag.
+     * Use tag returning methods of appropriate subclasses of \class File instead.
+     *
      * \see File::tag()
      */
     Tag *tag() const;
--- trunk/kdesupport/taglib/taglib/toolkit/tstring.h #1217765:1217766
@@ -37,6 +37,9 @@
  * \relates TagLib::String
  *
  * Converts a QString to a TagLib::String without a requirement to link to Qt.
+ *
+ * \note consider conversion via usual char-by-char for loop to avoid UTF16->UTF8->UTF16
+ * conversion happening in the background
  */
 #define QStringToTString(s) TagLib::String(s.utf8().data(), TagLib::String::UTF8)
 
@@ -44,6 +47,10 @@
  * \relates TagLib::String
  *
  * Converts a TagLib::String to a QString without a requirement to link to Qt.
+ *
+ * \note consider conversion via usual char-by-char for loop to avoid UTF16->UTF8->UTF16
+ * conversion happening in the background
+ *
  */
 #define TStringToQString(s) QString::fromUtf8(s.toCString(true))
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic