[platform] prevent possible u32 overflow
Merge branch 'master' into coverity_scan