diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/tools/qlist.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index e6f041f..4eb05d6 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -641,6 +641,8 @@ Q_OUTOFLINE_TEMPLATE QList<T> QList<T>::mid(int pos, int alength) const if (pos == 0 && alength == size()) return *this; QList<T> cpy; + if (alength <= 0) + return cpy; cpy.reserve(alength); cpy.d->end = alength; QT_TRY { |