- Encrypted frames taglib/Amarok crash (kde#161721)

This commit is contained in:
Rex Dieter 2008-10-06 20:54:30 +00:00
parent 4cd7020f0f
commit 42c1a7d0f3
3 changed files with 23 additions and 35 deletions

View File

@ -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;

View File

@ -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<CommentsFrame *>(*it)->description().isEmpty())
+ CommentsFrame *frame = dynamic_cast<CommentsFrame *>(*it);
+
+ if(frame && frame->description().isEmpty())
return (*it)->toString();
}

View File

@ -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 <rdieter@fedoraproject.org> 1.5-2
- Encrypted frames taglib/Amarok crash (kde#161721)
* Wed Feb 20 2008 Rex Dieter <rdieter@fedoraproject.org> 1.5-1
- taglib-1.5