From 42c1a7d0f3bc55713bbf7b9d0ceb6c07daf5cef6 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Mon, 6 Oct 2008 20:54:30 +0000 Subject: [PATCH] - Encrypted frames taglib/Amarok crash (kde#161721) --- taglib-1.4_wchar.diff | 31 ------------------------------- taglib-1.5-kde#161721.patch | 14 ++++++++++++++ taglib.spec | 13 +++++++++---- 3 files changed, 23 insertions(+), 35 deletions(-) delete mode 100644 taglib-1.4_wchar.diff create mode 100644 taglib-1.5-kde#161721.patch diff --git a/taglib-1.4_wchar.diff b/taglib-1.4_wchar.diff deleted file mode 100644 index b84a614..0000000 --- a/taglib-1.4_wchar.diff +++ /dev/null @@ -1,31 +0,0 @@ -diff -ruN taglib-1.4.org/taglib/toolkit/tstring.cpp taglib-1.4/taglib/toolkit/tstring.cpp ---- taglib-1.4.org/taglib/toolkit/tstring.cpp 2005-07-26 06:31:15.000000000 +0900 -+++ taglib-1.4/taglib/toolkit/tstring.cpp 2006-05-26 12:02:55.000000000 +0900 -@@ -202,12 +202,22 @@ - s.resize(d->data.size()); - - if(!unicode) { -- std::string::iterator targetIt = s.begin(); -- for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++) { -- *targetIt = char(*it); -- ++targetIt; -+ bool cjk = false; -+ //pre-scan: is there any cjk unicode character? if so, convert the string into utf-8. -+ for(unsigned int i=0; i< d->data.size(); i++){ -+ if(d->data[i] > 0xff){ -+ cjk = true; -+ break; -+ } -+ } -+ if(!cjk){ -+ std::string::iterator targetIt = s.begin(); -+ for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); it++) { -+ *targetIt = char(*it); -+ ++targetIt; -+ } -+ return s; - } -- return s; - } - - const int outputBufferSize = d->data.size() * 3 + 1; diff --git a/taglib-1.5-kde#161721.patch b/taglib-1.5-kde#161721.patch new file mode 100644 index 0000000..461f2ad --- /dev/null +++ b/taglib-1.5-kde#161721.patch @@ -0,0 +1,14 @@ +diff -up taglib-1.5/taglib/mpeg/id3v2/id3v2tag.cpp.kde#161721 taglib-1.5/taglib/mpeg/id3v2/id3v2tag.cpp +--- taglib-1.5/taglib/mpeg/id3v2/id3v2tag.cpp.kde#161721 2008-02-04 14:33:54.000000000 -0600 ++++ taglib-1.5/taglib/mpeg/id3v2/id3v2tag.cpp 2008-10-06 15:52:08.000000000 -0500 +@@ -125,7 +125,9 @@ String ID3v2::Tag::comment() const + + for(FrameList::ConstIterator it = comments.begin(); it != comments.end(); ++it) + { +- if(static_cast(*it)->description().isEmpty()) ++ CommentsFrame *frame = dynamic_cast(*it); ++ ++ if(frame && frame->description().isEmpty()) + return (*it)->toString(); + } + diff --git a/taglib.spec b/taglib.spec index 1bcd423..accd287 100644 --- a/taglib.spec +++ b/taglib.spec @@ -3,7 +3,7 @@ Name: taglib Version: 1.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Audio Meta-Data Library Group: System Environment/Libraries @@ -15,14 +15,15 @@ Source0: http://developer.kde.org/~wheeler/files/src/taglib-%{version}.tar.gz Source1: taglib-svn.sh BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -# what is this for? why not upstreamed, yet? Aurelien? -- Rex -Patch0: http://foetida.jaist.ac.jp:37565/~yaz/diary/2006/07/taglib-1.4_wchar.diff # http://bugzilla.redhat.com/343241 # try 1, use pkg-config Patch1: taglib-1.5b1-multilib.patch # try 2, kiss omit -L%_libdir Patch2: taglib-1.5rc1-multilib.patch +## upstream patches +Patch100: taglib-1.5-kde#161721.patch + BuildRequires: cmake BuildRequires: zlib-devel @@ -45,9 +46,10 @@ Requires: pkgconfig %setup -q -n taglib-%{version}%{?beta} ## omit for now -#patch0 -p1 -b .wchar %patch2 -p1 -b .multilib +%patch100 -p1 -b .kde#161721.patch + %build mkdir -p %{_target_platform} @@ -92,6 +94,9 @@ rm -rf %{buildroot} %changelog +* Mon Oct 06 2008 Rex Dieter 1.5-2 +- Encrypted frames taglib/Amarok crash (kde#161721) + * Wed Feb 20 2008 Rex Dieter 1.5-1 - taglib-1.5