Fixed possible overflow in create_mask().

Fixed possible overflow in create_mask().