Don't die on invalid input.

git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@315934 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Scott Wheeler 2004-05-29 20:12:36 +00:00
parent 9320aa0bbc
commit 05e484830c

View File

@ -158,6 +158,9 @@ String::String(const ByteVector &v, Type t)
{
d = new StringPrivate;
if(v.isEmpty())
return;
if(t == Latin1 || t == UTF8) {
int length = 0;
@ -175,7 +178,7 @@ String::String(const ByteVector &v, Type t)
wstring::iterator targetIt = d->data.begin();
for(ByteVector::ConstIterator it = v.begin();
it + 1 != v.end() && combine(*it, *(it + 1));
it != v.end() && it + 1 != v.end() && combine(*it, *(it + 1));
it += 2)
{
*targetIt = combine(*it, *(it + 1));