From 110cac8429bdf660e7749ced7054b0d1728df75c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Sat, 10 Mar 2012 08:46:20 +0100 Subject: [PATCH] Avoid uint overflow in case the length + index is over UINT_MAX --- taglib/toolkit/tbytevector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taglib/toolkit/tbytevector.cpp b/taglib/toolkit/tbytevector.cpp index 9fb77b12..e5dcf1d8 100644 --- a/taglib/toolkit/tbytevector.cpp +++ b/taglib/toolkit/tbytevector.cpp @@ -363,7 +363,7 @@ ByteVector ByteVector::mid(uint index, uint length) const ConstIterator endIt; - if(length < 0xffffffff && length + index < size()) + if(length < size() - index) endIt = d->data.begin() + index + length; else endIt = d->data.end();