optimize block size without overflows fix #5755