diff --git a/taglib/toolkit/tbytevector.cpp b/taglib/toolkit/tbytevector.cpp index 22ce2d4f..62f0fbef 100644 --- a/taglib/toolkit/tbytevector.cpp +++ b/taglib/toolkit/tbytevector.cpp @@ -489,6 +489,8 @@ ByteVector &ByteVector::replace(char oldByte, char newByte) ByteVector &ByteVector::replace(const ByteVector &pattern, const ByteVector &with) { + // TODO: This takes O(n!) time in the worst case. Rewrite it to run in O(n) time. + if(pattern.size() == 0 || pattern.size() > size()) return *this;