[3.8] Fix 1421 overflow issue

- FIx #1421