summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--amarok/src/debug.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/amarok/src/debug.h b/amarok/src/debug.h
index 6fe48cc0..d212f9fe 100644
--- a/amarok/src/debug.h
+++ b/amarok/src/debug.h
@@ -194,7 +194,10 @@ namespace Debug LIBAMAROK_EXPORT
double duration = double(end.tv_sec) + (double(end.tv_usec) / 1000000.0);
- Debug::modifieableIndent().truncate( Debug::indent().length() - 2 );
+ // Prevent overflow that causes UINT_MAX allocation.
+ uint newLength = (Debug::indent().length() < 2) ? 0 : (Debug::indent().length() - 2);
+ Debug::modifieableIndent().truncate( newLength );
+
kdDebug() << "END__: " << m_label
<< " - Took " << TQString::number( duration, 'g', 2 ) << "s\n";
mutex.unlock();