Merge "Rephrase code to avoid overflow" into qt-qpr1-dev am: 35b08ba4e0

Change-Id: Ic942597008e0f9816f0a7ec8f77d85a0efb99f11