From: Scott Wheeler Date: Tue, 17 May 2005 20:45:05 +0000 (+0000) Subject: Do a bounds check before trying to find the mid. X-Git-Tag: v1.5~287 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc8c7d357b9fd53940d6ced8aebea04cd4ac6aa5;p=taglib Do a bounds check before trying to find the mid. CCMAIL:Felix Hupfeld git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@415196 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- diff --git a/toolkit/tbytevector.cpp b/toolkit/tbytevector.cpp index de4ca6f9..7dff7462 100644 --- a/toolkit/tbytevector.cpp +++ b/toolkit/tbytevector.cpp @@ -344,6 +344,9 @@ ByteVector ByteVector::mid(uint index, uint length) const { ByteVector v; + if(index > size()) + return v; + ConstIterator endIt; if(length < 0xffffffff && length + index < size())