more defensive resize handling

Thanks John Blommers for the report!

Created by  Kartik K. Agaram  on June 8, 2022
K464QQR4FTXFUMHFWAGOD5DJ6YHUBUKRHLXF2ORE74DVT7TVQ35QC
Change contents