In one example, we pass in max size_t value as the limit, and the line unsigned i = std::max<int>(m_current - limit, 0) returns a positive integer that's >= m_current, when we expect it to be 0.
Created attachment 63103 [details] Patch
Comment on attachment 63103 [details] Patch Much cleaner.
Fixed in r64381.